Do not try to chflags() a symbolic link when copying an underlying filesytem
[dragonfly.git] / test / sysperf / getuid_msg.c
1 /*
2  * getuid_msg.c
3  *
4  * $DragonFly: src/test/sysperf/getuid_msg.c,v 1.1 2003/08/12 02:29:44 dillon Exp $
5  */
6
7 #include <sys/types.h>
8 #include <sys/param.h>
9 #include <sys/msgport.h>
10 #include <sys/syscall.h>
11 #include <sys/sysproto.h>
12 #include <sys/sysunion.h>
13
14 #include "../sysmsg/sendsys.h"
15
16 int
17 getuid_msg(void)
18 {
19     static struct getuid_args uidmsg;
20     int error;
21
22     /*
23      * In real life use a properly pre-initialized message, e.g. stowed in 
24      * the thread structure or cached in a linked list somewhere.
25      * bzero(&sysmsg.lmsg, sizeof(sysmsg.lmsg))
26      */
27     uidmsg.usrmsg.umsg.ms_cmd = SYS_getuid;     /* XXX lwkt_init_msg() */
28     uidmsg.usrmsg.umsg.ms_flags = MSGF_DONE;
29
30     error = sendsys(NULL, &uidmsg, sizeof(uidmsg));
31     if (error) {
32         printf("error %d\n", error);
33         exit(1);
34     }
35     return(uidmsg.usrmsg.umsg.u.ms_result32);
36 }
37