]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4con/examples/xf86_stub/include-xorg-7.1.0/xf86_libc.h
Inital import
[l4.git] / l4 / pkg / l4con / examples / xf86_stub / include-xorg-7.1.0 / xf86_libc.h
1 /* $XdotOrg: xserver/xorg/hw/xfree86/os-support/xf86_libc.h,v 1.9 2005/08/24 11:18:31 daniels Exp $ */
2 /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.63 2003/12/08 21:46:55 alanh Exp $ */
3 /*
4  * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22  * OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * Except as contained in this notice, the name of the copyright holder(s)
25  * and author(s) shall not be used in advertising or otherwise to promote
26  * the sale, use or other dealings in this Software without prior written
27  * authorization from the copyright holder(s) and author(s).
28  */
29
30 /*
31  * This file is an attempt to make developing code for the new loadable module
32  * architecure simpler. It tries to use macros to hide all libc wrappers so
33  * that all that is needed to "port" a module to this architecture is to
34  * include this one header file
35  *
36  * Revision history:
37  *
38  *
39  * 0.4  Apr 12 1997     add the ANSI defines
40  * 0.3  Feb 24 1997     handle getenv
41  * 0.2  Feb 24 1997     hide few FILE functions
42  * 0.1  Feb 24 1997     hide the trivial functions mem* str*
43  */
44
45 #ifndef XF86_LIBC_H
46 #define XF86_LIBC_H 1
47
48 #include <X11/Xfuncs.h>
49 #include <stddef.h>
50
51 /*
52  * The first set of definitions are required both for modules and
53  * libc_wrapper.c.
54  */
55
56 #if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
57
58 /*
59  * First, the new data types
60  *
61  * note: if some pointer is declared "opaque" here, pass it between
62  * xf86* functions only, and don't rely on it having a whatever internal
63  * structure, even if some source file might reveal the existence of
64  * such a structure.
65  */
66 typedef void XF86FILE;          /* opaque FILE replacement */
67 extern  XF86FILE* xf86stdin;
68 extern  XF86FILE* xf86stdout;
69 extern  XF86FILE* xf86stderr;
70
71 typedef void XF86fpos_t;        /* opaque fpos_t replacement */
72
73 #define _XF86NAMELEN    263     /* enough for a larger filename */
74                                 /* (divisble by 8) */
75 typedef void XF86DIR;           /* opaque DIR replacement */
76
77 /* Note: the following is POSIX! POSIX only requires the d_name member. 
78  * Normal Unix has often a number of other members, but don't rely on that
79  */
80 struct _xf86dirent {            /* types in struct dirent/direct: */
81         char    d_name[_XF86NAMELEN+1]; /* char [MAXNAMLEN]; might be smaller or unaligned */
82 };
83 typedef struct _xf86dirent XF86DIRENT;
84
85 typedef unsigned long xf86size_t;
86 typedef signed long xf86ssize_t;
87 typedef unsigned long xf86dev_t;
88 typedef unsigned int xf86mode_t;
89 typedef unsigned int xf86uid_t;
90 typedef unsigned int xf86gid_t;
91
92 struct xf86stat {
93     xf86dev_t st_rdev;  /* This is incomplete, and makes assumptions */
94 };
95
96 /* sysv IPC */
97 typedef int xf86key_t;
98
99 /* setjmp/longjmp */
100 #if defined(__ia64__)
101 typedef int xf86jmp_buf[1024] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */
102 #else
103 typedef int xf86jmp_buf[1024];
104 #endif
105
106 /* for setvbuf */
107 #define XF86_IONBF    1
108 #define XF86_IOFBF    2
109 #define XF86_IOLBF    3
110
111 /* for open (XXX not complete) */
112 #define XF86_O_RDONLY   0x0000
113 #define XF86_O_WRONLY   0x0001
114 #define XF86_O_RDWR     0x0002
115 #define XF86_O_CREAT    0x0200
116
117 /* for mmap */
118 #define XF86_PROT_EXEC          0x0001
119 #define XF86_PROT_READ          0x0002
120 #define XF86_PROT_WRITE         0x0004
121 #define XF86_PROT_NONE          0x0008
122 #define XF86_MAP_FIXED          0x0001
123 #define XF86_MAP_SHARED         0x0002
124 #define XF86_MAP_PRIVATE        0x0004
125 #define XF86_MAP_32BIT          0x0040
126 #define XF86_MAP_FAILED         ((void *)-1)
127
128 /* for fseek */
129 #define XF86_SEEK_SET   0
130 #define XF86_SEEK_CUR   1
131 #define XF86_SEEK_END   2
132
133 /* for access */
134 #define XF86_R_OK       0
135 #define XF86_W_OK       1
136 #define XF86_X_OK       2
137 #define XF86_F_OK       3
138
139 /* for chmod */
140 #define XF86_S_ISUID   04000 /* set user ID on execution */
141 #define XF86_S_ISGID   02000 /* set group ID on execution */
142 #define XF86_S_ISVTX   01000 /* sticky bit */
143 #define XF86_S_IRUSR   00400 /* read by owner */
144 #define XF86_S_IWUSR   00200 /* write by owner */
145 #define XF86_S_IXUSR   00100 /* execute/search by owner */
146 #define XF86_S_IRGRP   00040 /* read by group */
147 #define XF86_S_IWGRP   00020 /* write by group */
148 #define XF86_S_IXGRP   00010 /* execute/search by group */
149 #define XF86_S_IROTH   00004 /* read by others */
150 #define XF86_S_IWOTH   00002 /* write by others */
151 #define XF86_S_IXOTH   00001 /* execute/search by others */
152
153 /* for mknod */
154 #define XF86_S_IFREG 0010000
155 #define XF86_S_IFCHR 0020000
156 #define XF86_S_IFBLK 0040000
157 #define XF86_S_IFIFO 0100000
158
159 /*
160  * errno values
161  * They start at 1000 just so they don't match real errnos at all
162  */
163 #define xf86_UNKNOWN            1000
164 #define xf86_EACCES             1001
165 #define xf86_EAGAIN             1002
166 #define xf86_EBADF              1003
167 #define xf86_EEXIST             1004
168 #define xf86_EFAULT             1005
169 #define xf86_EINTR              1006
170 #define xf86_EINVAL             1007
171 #define xf86_EISDIR             1008
172 #define xf86_ELOOP              1009
173 #define xf86_EMFILE             1010
174 #define xf86_ENAMETOOLONG       1011
175 #define xf86_ENFILE             1012
176 #define xf86_ENOENT             1013
177 #define xf86_ENOMEM             1014
178 #define xf86_ENOSPC             1015
179 #define xf86_ENOTDIR            1016
180 #define xf86_EPIPE              1017
181 #define xf86_EROFS              1018
182 #define xf86_ETXTBSY            1019
183 #define xf86_ENOTTY             1020
184 #define xf86_ENOSYS             1021
185 #define xf86_EBUSY              1022
186 #define xf86_ENODEV             1023
187 #define xf86_EIO                1024
188
189 #define xf86_ESRCH              1025
190 #define xf86_ENXIO              1026
191 #define xf86_E2BIG              1027
192 #define xf86_ENOEXEC            1028
193 #define xf86_ECHILD             1029
194 #define xf86_ENOTBLK            1030
195 #define xf86_EXDEV              1031
196 #define xf86_EFBIG              1032
197 #define xf86_ESPIPE             1033
198 #define xf86_EMLINK             1034
199 #define xf86_EDOM               1035
200 #define xf86_ERANGE             1036
201  
202
203 /* sysv IPV */
204 /* xf86shmget() */
205 #define XF86IPC_CREAT  01000
206 #define XF86IPC_EXCL   02000
207 #define XF86IPC_NOWAIT 04000
208 #define XF86SHM_R           0400         
209 #define XF86SHM_W           0200            
210 #define XF86IPC_PRIVATE ((xf86key_t)0)
211 /* xf86shmat() */
212 #define XF86SHM_RDONLY      010000      /* attach read-only else read-write */
213 #define XF86SHM_RND         020000      /* round attach address to SHMLBA */
214 #define XF86SHM_REMAP       040000      /* take-over region on attach */
215 /* xf86shmclt() */
216 #define XF86IPC_RMID 0
217
218 #endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */
219
220 /*
221  * the rest of this file should only be included for code that is supposed
222  * to go into modules
223  */
224
225 #if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS)
226
227 #undef abort
228 #define abort()                 xf86abort()
229 #undef abs
230 #define abs(i)                  xf86abs(i)
231 #undef acos
232 #define acos(d)                 xf86acos(d)
233 #undef asin
234 #define asin(d)                 xf86asin(d)
235 #undef atan
236 #define atan(d)                 xf86atan(d)
237 #undef atan2
238 #define atan2(d1,d2)            xf86atan2(d1,d2)
239 #undef atof
240 #define atof(ccp)               xf86atof(ccp)
241 #undef atoi
242 #define atoi(ccp)               xf86atoi(ccp)
243 #undef atol
244 #define atol(ccp)               xf86atol(ccp)
245 #undef bsearch
246 #define bsearch(a,b,c,d,e)      xf86bsearch(a,b,c,d,e)
247 #undef ceil
248 #define ceil(d)                 xf86ceil(d)
249 #undef calloc
250 #define calloc(I1,I2)           xf86calloc(I1,I2)
251 #undef clearerr
252 #define clearerr(FP)            xf86clearerr(FP)
253 #undef cos
254 #define cos(d)                  xf86cos(d)
255 #undef exit
256 #define exit(i)                 xf86exit(i)
257 #undef exp
258 #define exp(d)                  xf86exp(d)
259 #undef fabs
260 #define fabs(d)                 xf86fabs(d)
261 #undef fclose
262 #define fclose(FP)              xf86fclose(FP)
263 #undef feof
264 #define feof(FP)                xf86feof(FP)
265 #undef ferror
266 #define ferror(FP)              xf86ferror(FP)
267 #undef fflush
268 #define fflush(FP)              xf86fflush(FP)
269 #undef fgetc
270 #define fgetc(FP)               xf86fgetc(FP)
271 #undef getc
272 #define getc(FP)                xf86getc(FP)
273 #undef fgetpos
274 #define fgetpos(FP,fpp)         xf86fgetpos(FP,fpp)
275 #undef fgets
276 #define fgets(cp,i,FP)          xf86fgets(cp,i,FP)
277 #undef finite
278 #define finite(d)               xf86finite(d)
279 #undef floor
280 #define floor(d)                xf86floor(d)
281 #undef fmod
282 #define fmod(d1,d2)             xf86fmod(d1,d2)
283 #undef fopen
284 #define fopen(ccp1,ccp2)        xf86fopen(ccp1,ccp2)
285 #undef printf
286 #define printf                  xf86printf
287 #undef fprintf
288 #define fprintf                 xf86fprintf
289 #undef fputc
290 #define fputc(i,FP)             xf86fputc(i,FP)
291 #undef fputs
292 #define fputs(ccp,FP)           xf86fputs(ccp,FP)
293 #undef fread
294 #define fread(vp,I1,I2,FP)      xf86fread(vp,I1,I2,FP)
295 #undef free
296 #define free(vp)                xf86free(vp)
297 #undef freopen
298 #define freopen(ccp1,ccp2,FP)   xf86freopen(ccp1,ccp2,FP)
299 #undef frexp
300 #define frexp(x,exp)            xf86frexp(x,exp)
301 #undef fscanf
302 #define fscanf                  xf86fscanf
303 #undef fseek
304 #define fseek(FP,l,i)           xf86fseek(FP,l,i)
305 #undef fsetpos
306 #define fsetpos(FP,cfpp)        xf86fsetpos(FP,cfpp)
307 #undef ftell
308 #define ftell(FP)               xf86ftell(FP)
309 #undef fwrite
310 #define fwrite(cvp,I1,I2,FP)    xf86fwrite(cvp,I1,I2,FP)
311 #undef getenv
312 #define getenv(ccp)             xf86getenv(ccp)
313 #undef isalnum
314 #define isalnum(i)              xf86isalnum(i)
315 #undef isalpha
316 #define isalpha(i)              xf86isalpha(i)
317 #undef iscntrl
318 #define iscntrl(i)              xf86iscntrl(i)
319 #undef isdigit
320 #define isdigit(i)              xf86isdigit(i)
321 #undef isgraph
322 #define isgraph(i)              xf86isgraph(i)
323 #undef islower
324 #define islower(i)              xf86islower(i)
325 #undef isprint
326 #define isprint(i)              xf86isprint(i)
327 #undef ispunct
328 #define ispunct(i)              xf86ispunct(i)
329 #undef isspace
330 #define isspace(i)              xf86isspace(i)
331 #undef isupper
332 #define isupper(i)              xf86isupper(i)
333 #undef isxdigit
334 #define isxdigit(i)             xf86isxdigit(i)
335 #undef labs
336 #define labs(l)                 xf86labs(l)
337 #undef ldexp
338 #define ldexp(x, exp)           xf86ldexp(x, exp)
339 #undef log
340 #define log(d)                  xf86log(d)
341 #undef log10
342 #define log10(d)                xf86log10(d)
343 #undef malloc
344 #define malloc(I)               xf86malloc(I)
345 #undef memchr
346 #define memchr(cvp,i,I)         xf86memchr(cvp,i,I)
347 #undef memcmp
348 #define memcmp(cvp1,cvp2,I)     xf86memcmp(cvp1,cvp2,I)
349 #undef memcpy
350 #define memcpy(vp,cvp,I)        xf86memcpy(vp,cvp,I)
351 #undef memmove
352 #define memmove(vp,cvp,I)       xf86memmove(vp,cvp,I)
353 #undef memset
354 #define memset(vp,int,I)        xf86memset(vp,int,I)
355 #undef modf
356 #define modf(d,dp)              xf86modf(d,dp)
357 #undef perror
358 #define perror(ccp)             xf86perror(ccp)
359 #undef pow
360 #define pow(d1,d2)              xf86pow(d1,d2)
361 #undef random
362 #define random()                xf86random()
363 #undef realloc
364 #define realloc(vp,I)           xf86realloc(vp,I)
365 #undef remove
366 #define remove(ccp)             xf86remove(ccp)
367 #undef rename
368 #define rename(ccp1,ccp2)       xf86rename(ccp1,ccp2)
369 #undef rewind
370 #define rewind(FP)              xf86rewind(FP)
371 #undef setbuf
372 #define setbuf(FP,cp)           xf86setbuf(FP,cp)
373 #undef setvbuf
374 #define setvbuf(FP,cp,i,I)      xf86setvbuf(FP,cp,i,I)
375 #undef sin
376 #define sin(d)                  xf86sin(d)
377 #undef snprintf
378 #define snprintf                xf86snprintf
379 #undef sprintf
380 #define sprintf                 xf86sprintf
381 #undef sqrt
382 #define sqrt(d)                 xf86sqrt(d)
383 #undef sscanf
384 #define sscanf                  xf86sscanf
385 #undef strcat
386 #define strcat(cp,ccp)          xf86strcat(cp,ccp)
387 #undef strcmp
388 #define strcmp(ccp1,ccp2)       xf86strcmp(ccp1,ccp2)
389 #undef strcasecmp
390 #define strcasecmp(ccp1,ccp2)   xf86strcasecmp(ccp1,ccp2)
391 #undef strcpy
392 #define strcpy(cp,ccp)          xf86strcpy(cp,ccp)
393 #undef strcspn
394 #define strcspn(ccp1,ccp2)      xf86strcspn(ccp1,ccp2)
395 #undef strerror
396 #define strerror(i)             xf86strerror(i)
397 #undef strlcat
398 #define strlcat(cp,ccp,I)       xf86strlcat(cp,ccp,I)
399 #undef strlcpy
400 #define strlcpy(cp,ccp,I)       xf86strlcpy(cp,ccp,I)
401 #undef strlen
402 #define strlen(ccp)             xf86strlen(ccp)
403 #undef strncmp
404 #define strncmp(ccp1,ccp2,I)    xf86strncmp(ccp1,ccp2,I)
405 #undef strncasecmp
406 #define strncasecmp(ccp1,ccp2,I) xf86strncasecmp(ccp1,ccp2,I)
407 #undef strncpy
408 #define strncpy(cp,ccp,I)       xf86strncpy(cp,ccp,I)
409 #undef strpbrk
410 #define strpbrk(ccp1,ccp2)      xf86strpbrk(ccp1,ccp2)
411 #undef strchr
412 #define strchr(ccp,i)           xf86strchr(ccp,i)
413 #undef strrchr
414 #define strrchr(ccp,i)          xf86strrchr(ccp,i)
415 #undef strspn
416 #define strspn(ccp1,ccp2)       xf86strspn(ccp1,ccp2)
417 #undef strstr
418 #define strstr(ccp1,ccp2)       xf86strstr(ccp1,ccp2)
419 #undef srttod
420 #define strtod(ccp,cpp)         xf86strtod(ccp,cpp)
421 #undef strtok
422 #define strtok(cp,ccp)          xf86strtok(cp,ccp)
423 #undef strtol
424 #define strtol(ccp,cpp,i)       xf86strtol(ccp,cpp,i)
425 #undef strtoul
426 #define strtoul(ccp,cpp,i)      xf86strtoul(ccp,cpp,i)
427 #undef tan
428 #define tan(d)                  xf86tan(d)
429 #undef tmpfile
430 #define tmpfile()               xf86tmpfile()
431 #undef tolower
432 #define tolower(i)              xf86tolower(i)
433 #undef toupper
434 #define toupper(i)              xf86toupper(i)
435 #undef ungetc
436 #define ungetc(i,FP)            xf86ungetc(i,FP)
437 #undef vfprinf
438 #define vfprintf(p,f,a)         xf86vfprintf(p,f,a)
439 #undef vsnprintf
440 #define vsnprintf(s,n,f,a)      xf86vsnprintf(s,n,f,a)
441 #undef vsprintf
442 #define vsprintf(s,f,a)         xf86vsprintf(s,f,a)
443 /* XXX Disable assert as if NDEBUG was defined */
444 /* Some X headers defined this away too */
445 #undef assert
446 #define assert(a)               ((void)0)
447 #undef HUGE_VAL
448 #define HUGE_VAL                xf86HUGE_VAL
449
450 #undef hypot
451 #define hypot(x,y)              xf86hypot(x,y)
452
453 #undef qsort
454 #define qsort(b, n, s, f)       xf86qsort(b, n, s, f)
455
456 /* non-ANSI C functions */
457 #undef opendir
458 #define opendir(cp)             xf86opendir(cp)
459 #undef closedir
460 #define closedir(DP)            xf86closedir(DP)
461 #undef readdir
462 #define readdir(DP)             xf86readdir(DP)
463 #undef rewinddir
464 #define rewinddir(DP)           xf86rewinddir(DP)
465 #undef bcopy
466 #define bcopy(vp,cvp,I)         xf86memmove(cvp,vp,I)
467 #undef ffs
468 #define ffs(i)                  xf86ffs(i)
469 #undef strdup
470 #define strdup(ccp)             xf86strdup(ccp)
471 #undef bzero
472 #define bzero(vp,ui)            xf86bzero(vp,ui)
473 #undef execl
474 #define execl                   xf86execl
475 #undef chmod
476 #define chmod(a,b)              xf86chmod(a,b)
477 #undef chown
478 #define chown(a,b,c)            xf86chown(a,b,c)
479 #undef geteuid
480 #define geteuid                 xf86geteuid
481 #undef getegid
482 #define getegid                 xf86getegid
483 #undef getpid
484 #define getpid                  xf86getpid
485 #undef mknod
486 #define mknod(a,b,c)            xf86mknod(a,b,c)
487 #undef sleep
488 #define sleep(a)                xf86sleep(a)
489 #undef mkdir
490 #define mkdir(a,b)              xf86mkdir(a,b)
491 #undef getpagesize
492 #define getpagesize             xf86getpagesize
493 #undef shmget
494 #define shmget(a,b,c)           xf86shmget(a,b,c)
495 #undef shmat
496 #define shmat(a,b,c)            xf86shmat(a,b,c)
497 #undef shmdt
498 #define shmdt(a)                xf86shmdt(a)
499 #undef shmctl
500 #define shmctl(a,b,c)           xf86shmctl(a,b,c)
501
502 #undef S_ISUID
503 #define S_ISUID XF86_S_ISUID
504 #undef S_ISGID
505 #define S_ISGID XF86_S_ISGID
506 #undef S_ISVTX
507 #define S_ISVTX XF86_S_ISVTX
508 #undef S_IRUSR
509 #define S_IRUSR XF86_S_IRUSR
510 #undef S_IWUSR
511 #define S_IWUSR XF86_S_IWUSR
512 #undef S_IXUSR
513 #define S_IXUSR XF86_S_IXUSR
514 #undef S_IRGRP
515 #define S_IRGRP XF86_S_IRGRP
516 #undef S_IWGRP
517 #define S_IWGRP XF86_S_IWGRP
518 #undef S_IXGRP
519 #define S_IXGRP XF86_S_IXGRP
520 #undef S_IROTH
521 #define S_IROTH XF86_S_IROTH
522 #undef S_IWOTH
523 #define S_IWOTH XF86_S_IWOTH
524 #undef S_IXOTH
525 #define S_IXOTH XF86_S_IXOTH
526 #undef S_IFREG
527 #define S_IFREG XF86_S_IFREG
528 #undef S_IFCHR
529 #define S_IFCHR XF86_S_IFCHR
530 #undef S_IFBLK
531 #define S_IFBLK XF86_S_IFBLK
532 #undef S_IFIFO
533 #define S_IFIFO XF86_S_IFIFO
534
535 /* some types */
536 #undef FILE
537 #define FILE                    XF86FILE
538 #undef fpos_t
539 #define fpos_t                  XF86fpos_t
540 #undef DIR
541 #define DIR                     XF86DIR
542 #undef DIRENT
543 #define DIRENT                  XF86DIRENT
544 #undef size_t
545 #define size_t                  xf86size_t
546 #undef ssize_t
547 #define ssize_t                 xf86ssize_t
548 #undef dev_t
549 #define dev_t                   xf86dev_t
550 #undef mode_t
551 #define mode_t                  xf86mode_t
552 #undef uid_t
553 #define uid_t                   xf86uid_t
554 #undef gid_t
555 #define gid_t                   xf86gid_t
556 #undef stat_t
557 #define stat_t                  struct xf86stat
558
559 #undef ulong
560 #define ulong                   unsigned long
561
562 /*
563  * There should be no need to #undef any of these.  If they are already
564  * defined it is because some illegal header has been included.
565  */
566
567 /* some vars */
568 #undef stdin
569 #define stdin                   xf86stdin
570 #undef stdout
571 #define stdout                  xf86stdout
572 #undef stderr
573 #define stderr                  xf86stderr
574
575 #undef SEEK_SET
576 #define SEEK_SET                XF86_SEEK_SET
577 #undef SEEK_CUR
578 #define SEEK_CUR                XF86_SEEK_CUR
579 #undef SEEK_END
580 #define SEEK_END                XF86_SEEK_END
581
582 /*
583  * XXX Basic I/O functions BAD,BAD,BAD!
584  */
585 #define open                    xf86open
586 #define close(a)                xf86close(a)
587 #define lseek(a,b,c)            xf86lseek(a,b,c)
588 #if !defined(__DragonFly__)
589 #define ioctl(a,b,c)            xf86ioctl(a,b,c)
590 #endif
591 #define read(a,b,c)             xf86read(a,b,c)
592 #define write(a,b,c)            xf86write(a,b,c)
593 #define mmap(a,b,c,d,e,f)       xf86mmap(a,b,c,d,e,f)
594 #define munmap(a,b)             xf86munmap(a,b)
595 #define stat(a,b)               xf86stat(a,b)
596 #define fstat(a,b)              xf86fstat(a,b)
597 #define access(a,b)             xf86access(a,b)
598 #undef O_RDONLY
599 #define O_RDONLY                XF86_O_RDONLY
600 #undef O_WRONLY
601 #define O_WRONLY                XF86_O_WRONLY
602 #undef O_RDWR
603 #define O_RDWR                  XF86_O_RDWR
604 #undef O_CREAT
605 #define O_CREAT                 XF86_O_CREAT
606 #undef PROT_EXEC
607 #define PROT_EXEC               XF86_PROT_EXEC
608 #undef PROT_READ
609 #define PROT_READ               XF86_PROT_READ
610 #undef PROT_WRITE
611 #define PROT_WRITE              XF86_PROT_WRITE
612 #undef PROT_NONE
613 #define PROT_NONE               XF86_PROT_NONE
614 #undef MAP_FIXED
615 #define MAP_FIXED               XF86_MAP_FIXED
616 #undef MAP_SHARED
617 #define MAP_SHARED              XF86_MAP_SHARED
618 #undef MAP_PRIVATE
619 #define MAP_PRIVATE             XF86_MAP_PRIVATE
620 #undef MAP_FAILED
621 #define MAP_FAILED              XF86_MAP_FAILED
622 #undef R_OK
623 #define R_OK                    XF86_R_OK
624 #undef W_OK
625 #define W_OK                    XF86_W_OK
626 #undef X_OK
627 #define X_OK                    XF86_X_OK
628 #undef F_OK
629 #define F_OK                    XF86_F_OK
630 #undef errno
631 #define errno                   xf86errno
632 #undef putchar
633 #define putchar(i)              xf86fputc(i, xf86stdout)
634 #undef puts
635 #define puts(s)                 xf86fputs(s, xf86stdout)
636
637 #undef EACCES
638 #define EACCES          xf86_EACCES
639 #undef EAGAIN
640 #define EAGAIN          xf86_EAGAIN
641 #undef EBADF
642 #define EBADF           xf86_EBADF
643 #undef EEXIST
644 #define EEXIST          xf86_EEXIST
645 #undef EFAULT
646 #define EFAULT          xf86_EFAULT
647 #undef EINTR
648 #define EINTR           xf86_EINTR
649 #undef EINVAL
650 #define EINVAL          xf86_EINVAL
651 #undef EISDIR
652 #define EISDIR          xf86_EISDIR
653 #undef ELOOP
654 #define ELOOP           xf86_ELOOP
655 #undef EMFILE
656 #define EMFILE          xf86_EMFILE
657 #undef ENAMETOOLONG
658 #define ENAMETOOLONG    xf86_ENAMETOOLONG
659 #undef ENFILE
660 #define ENFILE          xf86_ENFILE
661 #undef ENOENT
662 #define ENOENT          xf86_ENOENT
663 #undef ENOMEM
664 #define ENOMEM          xf86_ENOMEM
665 #undef ENOSPC
666 #define ENOSPC          xf86_ENOSPC
667 #undef ENOTDIR
668 #define ENOTDIR         xf86_ENOTDIR
669 #undef EPIPE
670 #define EPIPE           xf86_EPIPE
671 #undef EROFS
672 #define EROFS           xf86_EROFS
673 #undef ETXTBSY
674 #define ETXTBSY         xf86_ETXTBSY
675 #undef ENOTTY
676 #define ENOTTY          xf86_ENOTTY
677 #undef ENOSYS
678 #define ENOSYS          xf86_ENOSYS
679 #undef EBUSY
680 #define EBUSY           xf86_EBUSY
681 #undef ENODEV
682 #define ENODEV          xf86_ENODEV
683 #undef EIO
684 #define EIO             xf86_EIO
685
686 /* IPC stuff */
687 #undef SHM_RDONLY
688 #define SHM_RDONLY XF86SHM_RDONLY
689 #undef SHM_RND
690 #define SHM_RND XF86SHM_RND
691 #undef SHM_REMAP
692 #define SHM_REMAP XF86SHM_REMAP
693 #undef IPC_RMID
694 #define IPC_RMID XF86IPC_RMID
695 #undef IPC_CREAT
696 #define IPC_CREAT XF86IPC_CREAT
697 #undef IPC_EXCL
698 #define IPC_EXCL XF86IPC_EXCL
699 #undef PC_NOWAIT
700 #define IPC_NOWAIT XF86IPC_NOWAIT
701 #undef SHM_R
702 #define SHM_R XF86SHM_R
703 #undef SHM_W
704 #define SHM_W XF86SHM_W
705 #undef IPC_PRIVATE
706 #define IPC_PRIVATE XF86IPC_PRIVATE
707
708 /* Some ANSI macros */
709 #undef FILENAME_MAX
710 #define FILENAME_MAX            1024
711
712 #if (defined(sun) && defined(__SVR4)) 
713 # define _FILEDEFED /* Already have FILE defined, don't redefine it */
714 #endif
715
716 #endif /* XFree86LOADER  && !DONT_DEFINE_WRAPPERS */
717
718 #if defined(XFree86LOADER) && \
719     (!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS))
720 #undef setjmp
721 #define setjmp(a)               xf86setjmp_macro(a)
722 #undef longjmp
723 #define longjmp(a,b)            xf86longjmp(a,b) 
724 #undef jmp_buf
725 #define jmp_buf                 xf86jmp_buf
726 #endif
727
728 #endif /* XF86_LIBC_H */