VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/xf86_OSlib.h@ 97956

最後變更 在這個檔案從97956是 69098,由 vboxsync 提交於 7 年 前

Clean up XFree86 driver header files.
bugref:3810: X11 Guest Additions maintenance
Over the years we have cleaned up the layout in the tree of the X.Org
header files we use to build drivers. The XFree86 ones were still in their
original, rather sub-optimal layout. This change fixes that.

  • 屬性 svn:eol-style 設為 native
檔案大小: 20.7 KB
 
1/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.90 2002/05/31 18:46:00 dawes Exp $ */
2/*
3 * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
4 * Copyright 1992 by David Dawes <[email protected]>
5 * Copyright 1992 by Jim Tsillas <[email protected]>
6 * Copyright 1992 by Rich Murphey <[email protected]>
7 * Copyright 1992 by Robert Baron <[email protected]>
8 * Copyright 1992 by Orest Zborowski <[email protected]>
9 * Copyright 1993 by Vrije Universiteit, The Netherlands
10 * Copyright 1993 by David Wexelblat <[email protected]>
11 * Copyright 1994, 1996 by Holger Veit <[email protected]>
12 * Copyright 1997 by Takis Psarogiannakopoulos <[email protected]>
13 * Copyright 1994-1998 by The XFree86 Project, Inc
14 *
15 * Permission to use, copy, modify, distribute, and sell this software and its
16 * documentation for any purpose is hereby granted without fee, provided that
17 * the above copyright notice appear in all copies and that both that
18 * copyright notice and this permission notice appear in supporting
19 * documentation, and that the names of the above listed copyright holders
20 * not be used in advertising or publicity pertaining to distribution of
21 * the software without specific, written prior permission. The above listed
22 * copyright holders make no representations about the suitability of this
23 * software for any purpose. It is provided "as is" without express or
24 * implied warranty.
25 *
26 * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
27 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
28 * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
29 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
30 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
31 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
32 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
33 *
34 */
35
36/*
37 * The ARM32 code here carries the following copyright:
38 *
39 * Copyright 1997
40 * Digital Equipment Corporation. All rights reserved.
41 * This software is furnished under license and may be used and copied only in
42 * accordance with the following terms and conditions. Subject to these
43 * conditions, you may download, copy, install, use, modify and distribute
44 * this software in source and/or binary form. No title or ownership is
45 * transferred hereby.
46 *
47 * 1) Any source code used, modified or distributed must reproduce and retain
48 * this copyright notice and list of conditions as they appear in the
49 * source file.
50 *
51 * 2) No right is granted to use any trade name, trademark, or logo of Digital
52 * Equipment Corporation. Neither the "Digital Equipment Corporation"
53 * name nor any trademark or logo of Digital Equipment Corporation may be
54 * used to endorse or promote products derived from this software without
55 * the prior written permission of Digital Equipment Corporation.
56 *
57 * 3) This software is provided "AS-IS" and any express or implied warranties,
58 * including but not limited to, any implied warranties of merchantability,
59 * fitness for a particular purpose, or non-infringement are disclaimed.
60 * In no event shall DIGITAL be liable for any damages whatsoever, and in
61 * particular, DIGITAL shall not be liable for special, indirect,
62 * consequential, or incidental damages or damages for lost profits, loss
63 * of revenue or loss of use, whether such damages arise in contract,
64 * negligence, tort, under statute, in equity, at law or otherwise, even
65 * if advised of the possibility of such damage.
66 *
67 */
68
69/* $XConsortium: xf86_OSlib.h /main/22 1996/10/27 11:06:31 kaleb $ */
70
71/*
72 * This is private, and should not be included by any drivers. Drivers
73 * may include xf86_OSproc.h to get prototypes for public interfaces.
74 */
75
76#ifndef _XF86_OSLIB_H
77#define _XF86_OSLIB_H
78
79#include <X11/Xos.h>
80#include <X11/Xfuncproto.h>
81
82/*
83 * Define some things from the "ANSI" C wrappers that are needed in the
84 * the core server.
85 */
86#ifndef HAVE_WRAPPER_DECLS
87#define HAVE_WRAPPER_DECLS
88#undef usleep
89#define usleep(a) xf86usleep(a)
90extern void xf86usleep(unsigned long);
91extern int xf86getpagesize(void);
92extern int xf86GetErrno(void);
93typedef unsigned long xf86size_t;
94typedef signed long xf86ssize_t;
95#ifdef NEED_SNPRINTF
96extern int snprintf(char *str, size_t size, const char *format, ...);
97extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
98#endif
99#endif
100
101#include <stdio.h>
102#include <ctype.h>
103#include <stddef.h>
104
105/**************************************************************************/
106/* SYSV386 (SVR3, SVR4) - But not Solaris8 */
107/**************************************************************************/
108#if (defined(SYSV) || defined(SVR4)) && \
109 !defined(DGUX) && \
110 !defined(__SOL8__) && \
111 (!defined(sun) || defined(i386))
112# ifdef SCO325
113# ifndef _SVID3
114# define _SVID3
115# endif
116# ifndef _NO_STATIC
117# define _NO_STATIC
118# endif
119# endif
120# include <sys/ioctl.h>
121# include <signal.h>
122# include <termio.h>
123# include <sys/stat.h>
124# include <sys/types.h>
125# if defined(SCO) || defined(ISC)
126# include <sys/param.h>
127# endif
128
129# ifdef ISC
130# define TIOCMSET (TIOC|26) /* set all modem bits */
131# define TIOCMBIS (TIOC|27) /* bis modem bits */
132# define TIOCMBIC (TIOC|28) /* bic modem bits */
133# define TIOCMGET (TIOC|29) /* get all modem bits */
134# endif
135
136# include <errno.h>
137
138# if defined(PowerMAX_OS)
139# define HAS_USL_VTS
140# include <sys/immu.h>
141# include <sys/sysmacros.h>
142# elif defined(_NEED_SYSI86)
143# include <sys/immu.h>
144# if !(defined (sun) && defined (i386) && defined (SVR4))
145# include <sys/region.h>
146# endif
147# include <sys/proc.h>
148# include <sys/tss.h>
149# include <sys/sysi86.h>
150# if defined(SVR4) && !defined(sun)
151# include <sys/seg.h>
152# endif /* SVR4 && !sun */
153# if defined(sun) && defined (i386) && defined (SVR4) /* Solaris? */
154# if !defined(V86SC_IOPL) /* Solaris 7? */
155# include <sys/v86.h> /* Nope */
156# endif /* V86SC_IOPL */
157# else
158# include <sys/v86.h> /* Not solaris */
159# endif /* sun && i386 && SVR4 */
160# if defined(sun) && defined (i386) && defined (SVR4)
161# include <sys/psw.h>
162# endif
163# endif /* _NEED_SYSI86 */
164
165# if defined(HAS_SVR3_MMAPDRV)
166# include <sys/sysmacros.h>
167# if !defined(_NEED_SYSI86)
168# include <sys/immu.h>
169# include <sys/region.h>
170# endif
171# include <sys/mmap.h> /* MMAP driver header */
172# endif
173
174# if !defined(sun) || !defined(sparc)
175# define HAS_USL_VTS
176# endif
177# if !defined(sun)
178# include <sys/emap.h>
179# endif
180# if defined(SCO)
181# include <sys/vtkd.h>
182# include <sys/console.h>
183# include <sys/keyboard.h>
184# include <sys/vid.h>
185# define LED_CAP 0x01
186# define LED_NUM 0x02
187# define LED_SCR 0x04
188# elif defined(HAS_USL_VTS)
189# include <sys/at_ansi.h>
190# include <sys/kd.h>
191# include <sys/vt.h>
192# endif /* SCO */
193
194# if !defined(VT_ACKACQ)
195# define VT_ACKACQ 2
196# endif /* !VT_ACKACQ */
197
198# if defined(SCO)
199# include <sys/sysmacros.h>
200# define POSIX_TTY
201# endif /* SCO */
202
203# if defined(SVR4) || defined(SCO325)
204# include <sys/mman.h>
205# if !(defined(sun) && defined (i386) && defined (SVR4))
206# define DEV_MEM "/dev/pmem"
207# elif defined(PowerMAX_OS)
208# define DEV_MEM "/dev/iomem"
209# endif
210# ifdef SCO325
211# undef DEV_MEM
212# define DEV_MEM "/dev/mem"
213# endif
214# define CLEARDTR_SUPPORT
215# define POSIX_TTY
216# endif /* SVR4 */
217
218# ifdef ISC
219# include <termios.h>
220# define POSIX_TTY
221# endif
222
223# if defined(sun) && defined (i386) && defined (SVR4)
224# define USE_VT_SYSREQ
225# define VT_SYSREQ_DEFAULT TRUE
226# endif
227
228# if defined(ATT) && !defined(i386)
229# define i386 /* not defined in ANSI C mode */
230# endif /* ATT && !i386 */
231
232# if (defined(ATT) || defined(SVR4)) && !defined(sun) && !defined(SCO325)
233# ifndef XQUEUE
234# define XQUEUE
235# endif
236# include <sys/xque.h>
237# endif /* ATT || SVR4 */
238
239# ifdef SYSV
240# if !defined(ISC) || defined(ISC202) || defined(ISC22)
241# define NEED_STRERROR
242# endif
243# endif
244
245#endif /* (SYSV || SVR4) && !DGUX */
246
247/**********
248 * Good ol' Solaris8, and its lack of VT support
249 ***********/
250
251#if defined(__SOL8__) || (defined(sun) && !defined(i386))
252# include <sys/mman.h>
253# include <errno.h>
254# ifdef i386
255# include <sys/sysi86.h>
256# endif
257# include <sys/psw.h>
258
259# include <termio.h>
260# include <sys/fbio.h>
261# include <sys/kbd.h>
262# include <sys/kbio.h>
263
264# define LED_CAP LED_CAPS_LOCK
265# define LED_NUM LED_NUM_LOCK
266# define LED_SCR LED_SCROLL_LOCK
267
268# include <signal.h>
269
270#endif /* __SOL8__ */
271
272
273
274/**************************************************************************/
275/* DG/ux R4.20MU03 Intel AViion Machines */
276/**************************************************************************/
277#if defined(DGUX) && defined(SVR4)
278#include <sys/ioctl.h>
279#include <signal.h>
280#include <ctype.h>
281#include <termios.h> /* Use termios for BSD Flavor ttys */
282#include <sys/termios.h>
283#include <sys/stat.h>
284#include <sys/types.h>
285#include <sys/param.h>
286#include <errno.h>
287#include <sys/sysi86.h>
288#include <unistd.h>
289#include <sys/proc.h>
290#include <sys/map.h>
291#include <sys/sysmacros.h>
292#include <sys/mman.h> /* Memory handling */
293#include <sys/kd.h> /* definitios for KDENABIO KDDISABIO needed for IOPL s */
294#include <sys/kbd.h>
295#include <fcntl.h>
296#include <time.h>
297#include <sys/stream.h>
298#include <sys/ptms.h>
299
300#include <sys/socket.h>
301#include <sys/utsname.h>
302#include <sys/stropts.h>
303#include <sys/sockio.h>
304
305
306#define POSIX_TTY
307
308#undef HAS_USL_VTS
309#undef USE_VT_SYSREQ
310#undef VT_ACKACQ
311
312#define LED_CAP KBD_LED_CAPS_LOCK
313#define LED_NUM KBD_LED_NUM_LOCK
314#define LED_SCR KBD_LED_SCROLL_LOCK
315
316#define KDGKBTYPE KBD_GET_LANGUAGE
317
318
319/* General keyboard types */
320# define KB_84 2
321# define KB_101 1 /* Because ioctl(dgkeybdFd,KBD_GET_LANGUAGE,&type) gives 1=US keyboard */
322# define KB_OTHER 3
323
324#define KDSETLED KBD_SET_LED
325#define KDGETLED KBD_GET_STATE
326#undef KDMKTONE
327#define KDMKTONE KBD_TONE_HIGH
328
329
330#undef DEV_MEM
331#define DEV_MEM "/dev/mem"
332#define CLEARDTR_SUPPORT
333
334#undef VT_SYSREQ_DEFAULT
335#define VT_SYSREQ_DEFAULT FALSE /* Make sure that we dont define any VTs since DG/ux has none */
336
337#endif /* DGUX && SVR4 */
338
339/**************************************************************************/
340/* Linux */
341/**************************************************************************/
342#if defined(linux)
343# include <sys/ioctl.h>
344# include <signal.h>
345# include <termio.h>
346# ifdef __sparc__
347# include <sys/param.h>
348# endif
349
350# include <errno.h>
351
352# include <sys/stat.h>
353
354# define HAS_USL_VTS
355# include <sys/mman.h>
356# include <sys/kd.h>
357# include <sys/vt.h>
358# define LDGMAP GIO_SCRNMAP
359# define LDSMAP PIO_SCRNMAP
360# define LDNMAP LDSMAP
361
362# define CLEARDTR_SUPPORT
363# define USE_VT_SYSREQ
364
365# define POSIX_TTY
366
367#endif /* linux */
368
369/**************************************************************************/
370/* LynxOS AT */
371/**************************************************************************/
372#if defined(Lynx)
373
374# include <termio.h>
375# include <sys/ioctl.h>
376# include <param.h>
377# include <signal.h>
378# include <kd.h>
379# include <vt.h>
380# include <sys/stat.h>
381
382# include <errno.h>
383extern int errno;
384
385/* smem_create et.al. to access physical memory */
386# include <smem.h>
387
388/* keyboard types */
389# define KB_84 1
390# define KB_101 2
391# define KB_OTHER 3
392
393/* atc drivers ignores argument to VT_RELDISP ioctl */
394# define VT_ACKACQ 2
395
396# include <termios.h>
397# define POSIX_TTY
398# define CLEARDTR_SUPPORT
399
400/* LynxOS 2.5.1 has these */
401# ifdef LED_NUMLOCK
402# define LED_CAP LED_CAPSLOCK
403# define LED_NUM LED_NUMLOCK
404# define LED_SCR LED_SCROLLOCK
405# endif
406
407#endif /* Lynx */
408
409/**************************************************************************/
410/* 386BSD and derivatives, BSD/386 */
411/**************************************************************************/
412
413#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
414# undef __386BSD__
415#endif
416
417#ifdef CSRG_BASED
418# include <sys/ioctl.h>
419# include <signal.h>
420
421# include <termios.h>
422# define termio termios
423# define POSIX_TTY
424
425# include <errno.h>
426
427# if !defined(LINKKIT)
428 /* Don't need this stuff for the Link Kit */
429# if defined(__bsdi__)
430# include <i386/isa/pcconsioctl.h>
431# define CONSOLE_X_MODE_ON PCCONIOCRAW
432# define CONSOLE_X_MODE_OFF PCCONIOCCOOK
433# define CONSOLE_X_BELL PCCONIOCBEEP
434# else /* __bsdi__ */
435# if defined(__OpenBSD__)
436# ifdef PCCONS_SUPPORT
437# include <machine/pccons.h>
438# undef CONSOLE_X_MODE_ON
439# undef CONSOLE_X_MODE_OFF
440# undef CONSOLE_X_BELL
441# endif
442# endif
443# ifdef SYSCONS_SUPPORT
444# define COMPAT_SYSCONS
445# if defined(__NetBSD__) || defined(__OpenBSD__)
446# include <machine/console.h>
447# else
448# if defined(__FreeBSD__)
449# include <osreldate.h>
450# if __FreeBSD_version >= 410000
451# include <sys/consio.h>
452# include <sys/kbio.h>
453# else
454# include <machine/console.h>
455# endif /* FreeBSD 4.1 RELEASE or lator */
456# else
457# include <sys/console.h>
458# endif
459# endif
460# endif /* SYSCONS_SUPPORT */
461# if defined(PCVT_SUPPORT)
462# if !defined(SYSCONS_SUPPORT)
463 /* no syscons, so include pcvt specific header file */
464# if defined(__FreeBSD__)
465# include <machine/pcvt_ioctl.h>
466# else
467# if defined(__NetBSD__) || defined(__OpenBSD__)
468# if !defined(WSCONS_SUPPORT)
469# include <machine/pcvt_ioctl.h>
470# endif /* WSCONS_SUPPORT */
471# else
472# include <sys/pcvt_ioctl.h>
473# endif /* __NetBSD__ */
474# endif /* __FreeBSD__ || __OpenBSD__ */
475# else /* pcvt and syscons: hard-code the ID magic */
476# define VGAPCVTID _IOWR('V',113, struct pcvtid)
477 struct pcvtid {
478 char name[16];
479 int rmajor, rminor;
480 };
481# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
482# endif /* PCVT_SUPPORT */
483# ifdef WSCONS_SUPPORT
484# include <dev/wscons/wsconsio.h>
485# include <dev/wscons/wsdisplay_usl_io.h>
486# endif /* WSCONS_SUPPORT */
487# if defined(__FreeBSD__)
488# include <osreldate.h>
489# if __FreeBSD_version >= 500013
490# include <sys/mouse.h>
491# else
492# undef MOUSE_GETINFO
493# include <machine/mouse.h>
494# endif
495# endif
496 /* Include these definitions in case ioctl_pc.h didn't get included */
497# ifndef CONSOLE_X_MODE_ON
498# define CONSOLE_X_MODE_ON _IO('t',121)
499# endif
500# ifndef CONSOLE_X_MODE_OFF
501# define CONSOLE_X_MODE_OFF _IO('t',122)
502# endif
503# ifndef CONSOLE_X_BELL
504# define CONSOLE_X_BELL _IOW('t',123,int[2])
505# endif
506# ifndef CONSOLE_X_TV_ON
507# define CONSOLE_X_TV_ON _IOW('t',155,int)
508# define XMODE_RGB 0
509# define XMODE_NTSC 1
510# define XMODE_PAL 2
511# define XMODE_SECAM 3
512# endif
513# ifndef CONSOLE_X_TV_OFF
514# define CONSOLE_X_TV_OFF _IO('t',156)
515# endif
516#ifndef CONSOLE_GET_LINEAR_INFO
517# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
518#endif
519#ifndef CONSOLE_GET_IO_INFO
520# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
521#endif
522#ifndef CONSOLE_GET_MEM_INFO
523# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
524#endif
525# endif /* __bsdi__ */
526# endif /* !LINKKIT */
527
528# include <sys/types.h>
529# include <sys/mman.h>
530# include <sys/stat.h>
531
532# if defined(__bsdi__)
533# include <sys/param.h>
534# if (_BSDI_VERSION < 199510)
535# include <i386/isa/vgaioctl.h>
536# endif
537# endif /* __bsdi__ */
538
539#ifdef USE_I386_IOPL
540#include <machine/sysarch.h>
541#endif
542
543# define CLEARDTR_SUPPORT
544
545# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
546# define USE_VT_SYSREQ
547# endif
548
549#endif /* CSRG_BASED */
550
551/**************************************************************************/
552/* OS/2 */
553/**************************************************************************/
554/* currently OS/2 with a modified EMX/GCC compiler only */
555#if defined(__UNIXOS2__)
556# include <signal.h>
557# include <errno.h>
558# include <sys/stat.h>
559
560/* I would have liked to have this included here always, but
561 * it causes clashes for BYTE and BOOL with Xmd.h, which is too dangerous.
562 * So I'll include it in place where I know it does no harm.
563 */
564#if defined(I_NEED_OS2_H)
565# undef BOOL
566# undef BYTE
567# include <os2.h>
568#endif
569
570 /* keyboard types */
571# define KB_84 1
572# define KB_101 2
573/* could detect more keyboards */
574# define KB_OTHER 3
575
576 /* LEDs */
577# define LED_CAP 0x40
578# define LED_NUM 0x20
579# define LED_SCR 0x10
580
581 /* mouse driver */
582# define OSMOUSE_ONLY
583# define MOUSE_PROTOCOL_IN_KERNEL
584
585extern char* __XOS2RedirRoot(char*);
586
587#endif
588
589/**************************************************************************/
590/* QNX4 */
591/**************************************************************************/
592/* This is the QNX code for Watcom 10.6 and QNX 4.x */
593#if defined(QNX4)
594#include <signal.h>
595#include <errno.h>
596#include <sys/stat.h>
597#include <termios.h>
598#include <ioctl.h>
599#include <sys/param.h>
600
601/* Warning: by default, the fd_set size is 32 in QNX! */
602#define FD_SETSIZE 256
603#include <sys/select.h>
604
605 /* keyboard types */
606# define KB_84 1
607# define KB_101 2
608# define KB_OTHER 3
609
610 /* LEDs */
611# define LED_CAP 0x04
612# define LED_NUM 0x02
613# define LED_SCR 0x01
614
615# define POSIX_TTY
616# define OSMOUSE_ONLY
617# define MOUSE_PROTOCOL_IN_KERNEL
618
619#define TIOCM_DTR 0x0001 /* data terminal ready */
620#define TIOCM_RTS 0x0002 /* request to send */
621#define TIOCM_CTS 0x1000 /* clear to send */
622#define TIOCM_DSR 0x2000 /* data set ready */
623#define TIOCM_RI 0x4000 /* ring */
624#define TIOCM_RNG TIOCM_RI
625#define TIOCM_CD 0x8000 /* carrier detect */
626#define TIOCM_CAR TIOCM_CD
627#define TIOCM_LE 0x0100 /* line enable */
628#define TIOCM_ST 0x0200 /* secondary transmit */
629#define TIOCM_SR 0x0400 /* secondary receive */
630
631#endif
632
633/**************************************************************************/
634/* QNX/Neutrino */
635/**************************************************************************/
636/* This is the Neutrino code for for NTO2.0 and GCC */
637#if defined(__QNXNTO__)
638#include <signal.h>
639#include <errno.h>
640#include <sys/stat.h>
641#include <termios.h>
642#include <ioctl.h>
643#include <sys/param.h>
644
645/* Warning: by default, the fd_set size is 32 in NTO! */
646#define FD_SETSIZE 256
647#include <sys/select.h>
648
649 /* keyboard types */
650# define KB_84 1
651# define KB_101 2
652# define KB_OTHER 3
653
654# define POSIX_TTY
655
656#endif
657
658/**************************************************************************/
659/* GNU/Hurd */
660/**************************************************************************/
661#if defined(__GNU__)
662
663#include <stdlib.h>
664#include <sys/types.h>
665#include <errno.h>
666#include <signal.h>
667#include <sys/ioctl.h>
668#include <termios.h>
669#include <sys/stat.h>
670#include <assert.h>
671
672#define POSIX_TTY
673#define USE_OSMOUSE
674
675#endif /* __GNU__ */
676
677/**************************************************************************/
678/* Generic */
679/**************************************************************************/
680
681#include <sys/wait.h> /* May need to adjust this for other OSs */
682
683/*
684 * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
685 * and it's safe, so just do it.
686 */
687#if !defined(O_NDELAY) && defined(O_NONBLOCK)
688# define O_NDELAY O_NONBLOCK
689#endif /* !O_NDELAY && O_NONBLOCK */
690
691#if !defined(MAXHOSTNAMELEN)
692# define MAXHOSTNAMELEN 32
693#endif /* !MAXHOSTNAMELEN */
694
695#if !defined(X_NOT_POSIX)
696# if defined(_POSIX_SOURCE)
697# include <limits.h>
698# else
699# define _POSIX_SOURCE
700# include <limits.h>
701# undef _POSIX_SOURCE
702# endif /* _POSIX_SOURCE */
703#endif /* !X_NOT_POSIX */
704#if !defined(PATH_MAX)
705# if defined(MAXPATHLEN)
706# define PATH_MAX MAXPATHLEN
707# else
708# define PATH_MAX 1024
709# endif /* MAXPATHLEN */
710#endif /* !PATH_MAX */
711
712#ifdef NEED_STRERROR
713# ifndef strerror
714extern char *sys_errlist[];
715extern int sys_nerr;
716# define strerror(n) \
717 ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error"
718# endif /* !strerror */
719#endif /* NEED_STRERROR */
720
721#if defined(ISC) || defined(Lynx)
722#define rint(x) RInt(x)
723double RInt(
724#if NeedFunctionPrototypes
725 double x
726#endif
727);
728#endif
729
730#ifndef DEV_MEM
731#define DEV_MEM "/dev/mem"
732#endif
733
734#ifndef VT_SYSREQ_DEFAULT
735#define VT_SYSREQ_DEFAULT FALSE
736#endif
737
738#ifdef OSMOUSE_ONLY
739# ifndef MOUSE_PROTOCOL_IN_KERNEL
740# define MOUSE_PROTOCOL_IN_KERNEL
741# endif
742#endif
743
744#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
745
746#define XF86_OS_PRIVS
747#include "xf86_OSproc.h"
748
749#ifndef NO_COMPILER_H
750#include "compiler.h"
751#endif
752
753#endif /* _XF86_OSLIB_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette