]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/unistd.h
Fix GCC build errors.
[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 dup(int);
31 int rename(const char *, const char *);
32
33 /* Functions implemented for compatibility. */
34 int getopt(int, char * const [], const char *);
35 extern char *optarg; /* getopt(3) external variables */
36 extern int optind;
37 pid_t getpgrp(void);
38 pid_t tcgetpgrp(int);
39 char *getpass(const char *);
40
41 // Networking
42 long gethostid(void);
43 int gethostname(char *, size_t);
44 int getdomainname(char *, size_t);
45 int setdomainname(const char *, size_t);
46 int sethostid(long);
47 int sethostname(const char *, size_t);
48
49 /* Stub functions implemented for porting ease.
50 These functions always fail or return NULL.
51 */
52 __aconst char *getlogin(void);
53 pid_t fork(void);
54 uid_t getuid(void);
55
56 // For Future implementation
57 ssize_t pread(int, void *, size_t, off_t);
58 ssize_t pwrite(int, const void *, size_t, off_t);
59 int syscall(int, ...);
60
61 #if 0 // The following functions are not implemented
62 __dead void _exit(int) __attribute__((__noreturn__));
63 unsigned int alarm(unsigned int);
64 int chown(const char *, uid_t, gid_t);
65 size_t confstr(int, char *, size_t);
66 int execl(const char *, const char *, ...);
67 int execle(const char *, const char *, ...);
68 int execlp(const char *, const char *, ...);
69 int execv(const char *, char * const *);
70 int execve(const char *, char * const *, char * const *);
71 int execvp(const char *, char * const *);
72 long fpathconf(int, int);
73 gid_t getegid(void);
74 uid_t geteuid(void);
75 gid_t getgid(void);
76 int getgroups(int, gid_t []);
77 pid_t getpid(void);
78 pid_t getppid(void);
79 int link(const char *, const char *);
80 long pathconf(const char *, int);
81 int pause(void);
82 int pipe(int *);
83 int setgid(gid_t);
84 int setpgid(pid_t, pid_t);
85 pid_t setsid(void);
86 int setuid(uid_t);
87 unsigned int sleep(unsigned int);
88 long sysconf(int);
89
90 int tcsetpgrp(int, pid_t);
91 __aconst char *ttyname(int);
92
93 extern int opterr;
94 extern int optopt;
95 extern int optreset;
96 extern char *suboptarg;
97
98 int setegid(gid_t);
99 int seteuid(uid_t);
100 int fdatasync(int);
101 int fsync(int);
102 int ttyname_r(int, char *, size_t);
103 int chroot(const char *);
104 int nice(int);
105 __aconst char *crypt(const char *, const char *);
106 int encrypt(char *, int);
107 pid_t getsid(pid_t);
108
109 #ifndef intptr_t
110 typedef __intptr_t intptr_t;
111 #define intptr_t __intptr_t
112 #endif
113
114 int brk(void *);
115 int fchdir(int);
116 int fchown(int, uid_t, gid_t);
117 int getdtablesize(void);
118 __pure int getpagesize(void); /* legacy */
119 pid_t getpgid(pid_t);
120 int lchown(const char *, uid_t, gid_t);
121 int lockf(int, int, off_t);
122 ssize_t readlink(const char * __restrict, char * __restrict, size_t);
123 void *sbrk(intptr_t);
124 int setregid(gid_t, gid_t);
125 int setreuid(uid_t, uid_t);
126 void swab(const void *, void *, size_t);
127 int symlink(const char *, const char *);
128 void sync(void);
129 useconds_t ualarm(useconds_t, useconds_t);
130 int usleep(useconds_t);
131 pid_t vfork(void) __RENAME(__vfork14);
132
133 /*
134 * Implementation-defined extensions
135 */
136 int acct(const char *);
137 int closefrom(int);
138 int des_cipher(const char *, char *, long, int);
139 int des_setkey(const char *);
140 void endusershell(void);
141 int exect(const char *, char * const *, char * const *);
142 int fchroot(int);
143 int fsync_range(int, int, off_t, off_t);
144 int getgrouplist(const char *, gid_t, gid_t *, int *);
145 int getgroupmembership(const char *, gid_t, gid_t *, int, int *);
146 mode_t getmode(const void *, mode_t);
147 int getsubopt(char **, char * const *, char **);
148 __aconst char *getusershell(void);
149 int initgroups(const char *, gid_t);
150 int iruserok(uint32_t, int, const char *, const char *);
151 int issetugid(void);
152 int nfssvc(int, void *);
153 int profil(char *, size_t, u_long, u_int);
154 void psignal(unsigned int, const char *);
155 int rcmd(char **, int, const char *, const char *, const char *, int *);
156 int revoke(const char *);
157 int rresvport(int *);
158 int ruserok(const char *, int, const char *, const char *);
159 int setgroups(int, const gid_t *);
160 int setlogin(const char *);
161 void *setmode(const char *);
162 int setrgid(gid_t);
163 int setruid(uid_t);
164 void setusershell(void);
165 void strmode(mode_t, char *);
166 __aconst char *strsignal(int);
167 int swapctl(int, void *, int);
168 quad_t __syscall(quad_t, ...);
169 int undelete(const char *);
170 int rcmd_af(char **, int, const char *, const char *, const char *, int *, int);
171 int rresvport_af(int *, int);
172 int iruserok_sa(const void *, int, int, const char *, const char *);
173 #endif /* Unimplemented functions. */
174
175 __END_DECLS
176
177 #endif /* !_UNISTD_H_ */