Home | History | Annotate | Download | only in speculative
      1 /*
      2  * Copyright (c) 2003, Intel Corporation. All rights reserved.
      3  * Created by:  crystal.xiong REMOVE-THIS AT intel DOT com
      4  * This file is licensed under the GPL license.  For the full content
      5  * of this license, see the COPYING file at the top level of this
      6  * source tree.
      7  */
      8 
      9 /*
     10  *  mq_unlink() test plan:
     11  *  mq_unlink() fails with ENOENT, if the named message queue does not
     12  *  exist.
     13  *
     14  */
     15 
     16 #include <stdio.h>
     17 #include <errno.h>
     18 #include <string.h>
     19 #include <mqueue.h>
     20 #include <fcntl.h>
     21 #include <sys/stat.h>
     22 #include <sys/types.h>
     23 #include <unistd.h>
     24 #include "posixtest.h"
     25 
     26 #define TEST "7-2"
     27 #define FUNCTION "mq_unlink"
     28 
     29 int main(void)
     30 {
     31 	char mqname[50] = "/123";
     32 
     33 //      sprintf(mqname, FUNCTION "_" TEST "_%d", getpid());
     34 
     35 	mq_unlink(mqname);
     36 	if (ENOENT == errno) {
     37 		printf("Test PASSED\n");
     38 		return PTS_PASS;
     39 	} else {
     40 		printf("Test FAILED, error is %s\n", strerror(errno));
     41 		return PTS_FAIL;
     42 	}
     43 }
     44