]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/unistd.h
fc8d7381b760864d33e6a5eb1a5893a9578f14da
[mirror_edk2.git] / StdLib / Include / unistd.h
1 /** @file
2
3 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials are licensed and made available under
5 the terms and conditions of the BSD License that accompanies this distribution.
6 The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 **/
13 #ifndef _UNISTD_H_
14 #define _UNISTD_H_
15
16 //#include <machine/ansi.h>
17 //#include <machine/int_types.h>
18 //#include <sys/featuretest.h>
19 //#include <sys/types.h>
20 #include <sys/unistd.h>
21 #include <sys/EfiSysCall.h>
22
23 #define F_ULOCK 0
24 #define F_LOCK 1
25 #define F_TLOCK 2
26 #define F_TEST 3
27
28
29 __BEGIN_DECLS
30 int rename(const char *, const char *);
31
32 // Networking
33 long gethostid(void);
34 int gethostname(char *, size_t);
35 int getdomainname(char *, size_t);
36 int setdomainname(const char *, size_t);
37 int sethostid(long);
38 int sethostname(const char *, size_t);
39
40 // For Future implementation
41 __dead void _exit(int) __attribute__((__noreturn__));
42 ssize_t pread(int, void *, size_t, off_t);
43 ssize_t pwrite(int, const void *, size_t, off_t);
44 int syscall(int, ...);
45 int dup(int);
46 pid_t fork(void);
47
48 // The following *nix functions are not implemented
49 unsigned int alarm(unsigned int);
50 int chown(const char *, uid_t, gid_t);
51 size_t confstr(int, char *, size_t);
52 int execl(const char *, const char *, ...);
53 int execle(const char *, const char *, ...);
54 int execlp(const char *, const char *, ...);
55 int execv(const char *, char * const *);
56 int execve(const char *, char * const *, char * const *);
57 int execvp(const char *, char * const *);
58 long fpathconf(int, int);
59 gid_t getegid(void);
60 uid_t geteuid(void);
61 gid_t getgid(void);
62 int getgroups(int, gid_t []);
63 __aconst char *getlogin(void);
64 pid_t getpgrp(void);
65 pid_t getpid(void);
66 pid_t getppid(void);
67 uid_t getuid(void);
68 int link(const char *, const char *);
69 long pathconf(const char *, int);
70 int pause(void);
71 int pipe(int *);
72 int setgid(gid_t);
73 int setpgid(pid_t, pid_t);
74 pid_t setsid(void);
75 int setuid(uid_t);
76 unsigned int sleep(unsigned int);
77 long sysconf(int);
78 pid_t tcgetpgrp(int);
79 int tcsetpgrp(int, pid_t);
80 __aconst char *ttyname(int);
81
82 int getopt(int, char * const [], const char *);
83
84 extern char *optarg; /* getopt(3) external variables */
85 extern int opterr;
86 extern int optind;
87 extern int optopt;
88 extern int optreset; /* getopt(3) external variable */
89 extern char *suboptarg; /* getsubopt(3) external variable */
90
91 int setegid(gid_t);
92 int seteuid(uid_t);
93 int fdatasync(int);
94 int fsync(int);
95 int ttyname_r(int, char *, size_t);
96 int chroot(const char *);
97 int nice(int);
98 __aconst char *crypt(const char *, const char *);
99 int encrypt(char *, int);
100 char *getpass(const char *);
101 pid_t getsid(pid_t);
102
103 #ifndef intptr_t
104 typedef __intptr_t intptr_t;
105 #define intptr_t __intptr_t
106 #endif
107
108 int brk(void *);
109 int fchdir(int);
110 int fchown(int, uid_t, gid_t);
111 int getdtablesize(void);
112 __pure int getpagesize(void); /* legacy */
113 pid_t getpgid(pid_t);
114 int lchown(const char *, uid_t, gid_t);
115 int lockf(int, int, off_t);
116 ssize_t readlink(const char * __restrict, char * __restrict, size_t);
117 void *sbrk(intptr_t);
118 int setregid(gid_t, gid_t);
119 int setreuid(uid_t, uid_t);
120 void swab(const void *, void *, size_t);
121 int symlink(const char *, const char *);
122 void sync(void);
123 useconds_t ualarm(useconds_t, useconds_t);
124 int usleep(useconds_t);
125 pid_t vfork(void) __RENAME(__vfork14);
126
127 /*
128 * Implementation-defined extensions
129 */
130 int acct(const char *);
131 int closefrom(int);
132 int des_cipher(const char *, char *, long, int);
133 int des_setkey(const char *);
134 void endusershell(void);
135 int exect(const char *, char * const *, char * const *);
136 int fchroot(int);
137 int fsync_range(int, int, off_t, off_t);
138 int getgrouplist(const char *, gid_t, gid_t *, int *);
139 int getgroupmembership(const char *, gid_t, gid_t *, int, int *);
140 mode_t getmode(const void *, mode_t);
141 int getsubopt(char **, char * const *, char **);
142 __aconst char *getusershell(void);
143 int initgroups(const char *, gid_t);
144 int iruserok(uint32_t, int, const char *, const char *);
145 int issetugid(void);
146 int nfssvc(int, void *);
147 int profil(char *, size_t, u_long, u_int);
148 void psignal(unsigned int, const char *);
149 int rcmd(char **, int, const char *, const char *, const char *, int *);
150 int revoke(const char *);
151 int rresvport(int *);
152 int ruserok(const char *, int, const char *, const char *);
153 int setgroups(int, const gid_t *);
154 int setlogin(const char *);
155 void *setmode(const char *);
156 int setrgid(gid_t);
157 int setruid(uid_t);
158 void setusershell(void);
159 void strmode(mode_t, char *);
160 __aconst char *strsignal(int);
161 int swapctl(int, void *, int);
162 quad_t __syscall(quad_t, ...);
163 int undelete(const char *);
164 int rcmd_af(char **, int, const char *, const char *, const char *, int *, int);
165 int rresvport_af(int *, int);
166 int iruserok_sa(const void *, int, int, const char *, const char *);
167
168 __END_DECLS
169
170 #endif /* !_UNISTD_H_ */