From c89e913d713f4bdfbf13e9c0812677781c9a0468 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 21 Jun 1997 02:46:22 +0000 Subject: [PATCH] SunOS specific info header. --- sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h | 142 +++++++++++++++++++ sysdeps/unix/bsd/sun/sunos4/bits/resource.h | 139 +++++++++++++++++++ sysdeps/unix/bsd/sun/sunos4/bits/termios.h | 208 ++++++++++++++++++++++++++++ sysdeps/unix/bsd/sun/sunos4/bits/utsname.h | 2 + 4 files changed, 491 insertions(+) create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/resource.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/termios.h create mode 100644 sysdeps/unix/bsd/sun/sunos4/bits/utsname.h diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h b/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h new file mode 100644 index 0000000..b74c80e --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h @@ -0,0 +1,142 @@ +/* O_*, F_*, FD_* bit values for SunOS 4. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FCNTL_H +#error "Never use directly; include instead." +#endif + + +/* File access modes for `open' and `fcntl'. */ +#define O_RDONLY 0 /* Open read-only. */ +#define O_WRONLY 1 /* Open write-only. */ +#define O_RDWR 2 /* Open read/write. */ + + +/* Bits OR'd into the second argument to open. */ +#define O_CREAT 0x0200 /* Create file if it doesn't exist. */ +#define O_EXCL 0x0800 /* Fail if file already exists. */ +#define O_TRUNC 0x0400 /* Truncate file to zero length. */ +#define O_NOCTTY 0x8000 /* Don't assign a controlling terminal. */ +#if defined __USE_BSD || defined __USE_SVID +#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */ +#define O_FSYNC 0x2000 /* Synchronous writes. */ +#define O_SYNC O_FSYNC +#endif + +/* File status flags for `open' and `fcntl'. */ +#define O_APPEND 0x0008 /* Writes append to the file. */ +#define O_NONBLOCK 0x4000 /* Non-blocking I/O. */ + +/* Sun defines O_NDELAY one way for BSD behavior and another for System V + behavior. In the GNU C library, you get the BSD behavior unless you + define _USG_SOURCE without also defining _BSD_SOURCE or _GNU_SOURCE. */ +#ifdef __USE_BSD +#define O_NDELAY 0x0004 +#endif +#if !defined (O_NDELAY) && defined (__USE_SVID) +#define O_NDELAY 0x1000 +#endif + +#ifdef __USE_BSD +/* Bits in the file status flags returned by F_GETFL. + These are all the O_* flags, plus FREAD and FWRITE, which are + independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was + given to `open'. */ +#define FREAD 1 +#define FWRITE 2 + +/* Traditional Unix names the O_* bits. */ +#define FASYNC O_ASYNC +#define FCREAT O_CREAT +#define FEXCL O_EXCL +#define FTRUNC O_TRUNC +#define FNOCTTY O_NOCTTY +#define FFSYNC O_FSYNC +#define FSYNC O_SYNC +#define FAPPEND O_APPEND +#define FNONBLOCK O_NONBLOCK +#define FNONBIO O_NONBLOCK +#define FNDELAY 0x0004 /* BSD O_NDELAY. */ +#define FNBIO 0x1000 /* System V O_NDELAY. */ +#endif + +/* Mask for file access modes. This is system-dependent in case + some system ever wants to define some other flavor of access. */ +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) + +/* Values for the second argument to `fcntl'. */ +#define F_DUPFD 0 /* Duplicate file descriptor. */ +#define F_GETFD 1 /* Get file descriptor flags. */ +#define F_SETFD 2 /* Set file descriptor flags. */ +#define F_GETFL 3 /* Get file status flags. */ +#define F_SETFL 4 /* Set file status flags. */ +#ifdef __USE_BSD +#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */ +#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */ +#endif +#define F_GETLK 7 /* Get record locking info. */ +#define F_SETLK 8 /* Set record locking info (non-blocking). */ +#define F_SETLKW 9 /* Set record locking info (blocking). */ +#ifdef __USE_BSD +#define F_RGETLK 10 /* Get remote record locking info. */ +#define F_RSETLK 11 /* Set remote locking info (non-blocking). */ +#define F_CNVT 12 /* Convert a fhandle to an open fd. */ +#define F_RSETLKW 13 /* Set remote locking info (blocking). */ +#endif + +/* File descriptor flags used with F_GETFD and F_SETFD. */ +#define FD_CLOEXEC 1 /* Close on exec. */ + + +#include + +/* The structure describing an advisory lock. This is the type of the third + argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */ +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_pid; /* Process holding the lock. */ + short int l_xxx; /* Reserved for future use. */ + }; + +#ifdef __USE_BSD +/* The structure describing a remote advisory lock. This is the type of the + third arg to `fcntl' for the F_RGETLK, F_RSETLK, and F_RSETLKW requests. */ +struct eflock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ + short int l_pid; /* Process holding the lock. */ + short int l_xxx; /* Reserved for future use. */ + long int l_rpid; /* Remote process ID wanting this lock. */ + long int l_rsys; /* Remote system ID wanting this lock. */ + }; + +#endif + + +/* Values for the `l_type' field of a `struct flock'. */ +#define F_RDLCK 1 /* Read lock. */ +#define F_WRLCK 2 /* Write lock. */ +#define F_UNLCK 3 /* Remove lock. */ diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/resource.h b/sysdeps/unix/bsd/sun/sunos4/bits/resource.h new file mode 100644 index 0000000..ff55773 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/resource.h @@ -0,0 +1,139 @@ +/* Bit values for resource limits. SunOS 4 version. + Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a + subset of these kinds of resource limit. In systems where `getrlimit' + and `setrlimit' are not system calls, these are the values used by the C + library to emulate them. */ + +/* Kinds of resource limit. */ +enum __rlimit_resource + { + /* Per-process CPU limit, in seconds. */ + RLIMIT_CPU, +#define RLIMIT_CPU RLIMIT_CPU + /* Largest file that can be created, in bytes. */ + RLIMIT_FSIZE, +#define RLIMIT_FSIZE RLIMIT_FSIZE + /* Maximum size of data segment, in bytes. */ + RLIMIT_DATA, +#define RLIMIT_DATA RLIMIT_DATA + /* Maximum size of stack segment, in bytes. */ + RLIMIT_STACK, +#define RLIMIT_STACK RLIMIT_STACK + /* Largest core file that can be created, in bytes. */ + RLIMIT_CORE, +#define RLIMIT_CORE RLIMIT_CORE + /* Largest resident set size, in bytes. + This affects swapping; processes that are exceeding their + resident set size will be more likely to have physical memory + taken from them. */ + RLIMIT_RSS, +#define RLIMIT_RSS RLIMIT_RSS + /* Number of open files. */ + RLIMIT_NOFILE, + RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ +#define RLIMIT_NOFILE RLIMIT_NOFILE +#define RLIMIT_OFILE RLIMIT_OFILE + + RLIM_NLIMITS, + + RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */ +#define RLIM_INFINITY RLIM_INFINITY + }; + +struct rlimit + { + /* The current (soft) limit. */ + int rlim_cur; + /* The hard limit. */ + int rlim_max; + }; + +/* Whose usage statistics do you want? */ +enum __rusage_who +/* The macro definitions are necessary because some programs want + to test for operating system features with #ifdef RUSAGE_SELF. + In ISO C the reflexive definition is a no-op. */ + { + /* The calling process. */ + RUSAGE_SELF = 0, +#define RUSAGE_SELF RUSAGE_SELF + /* All of its terminated child processes. */ + RUSAGE_CHILDREN = -1 +#define RUSAGE_CHILDREN RUSAGE_CHILDREN + }; + +#include /* For `struct timeval'. */ + +/* Structure which says how much of each resource has been used. */ +struct rusage + { + /* Total amount of user time used. */ + struct timeval ru_utime; + /* Total amount of system time used. */ + struct timeval ru_stime; + /* Maximum resident set size (in kilobytes). */ + long int ru_maxrss; + /* Amount of sharing of text segment memory + with other processes (kilobyte-seconds). */ + long int ru_ixrss; + /* Amount of data segment memory used (kilobyte-seconds). */ + long int ru_idrss; + /* Amount of stack memory used (kilobyte-seconds). */ + long int ru_isrss; + /* Number of soft page faults (i.e. those serviced by reclaiming + a page from the list of pages awaiting reallocation. */ + long int ru_minflt; + /* Number of hard page faults (i.e. those that required I/O). */ + long int ru_majflt; + /* Number of times a process was swapped out of physical memory. */ + long int ru_nswap; + /* Number of input operations via the file system. Note: This + and `ru_oublock' do not include operations with the cache. */ + long int ru_inblock; + /* Number of output operations via the file system. */ + long int ru_oublock; + /* Number of IPC messages sent. */ + long int ru_msgsnd; + /* Number of IPC messages received. */ + long int ru_msgrcv; + /* Number of signals delivered. */ + long int ru_nsignals; + /* Number of voluntary context switches, i.e. because the process + gave up the process before it had to (usually to wait for some + resource to be available). */ + long int ru_nvcsw; + /* Number of involuntary context switches, i.e. a higher priority process + became runnable or the current process used up its time slice. */ + long int ru_nivcsw; + }; + +/* Priority limits. */ +#define PRIO_MIN -20 /* Minimum priority a process can have. */ +#define PRIO_MAX 20 /* Maximum priority a process can have. */ + +/* The type of the WHICH argument to `getpriority' and `setpriority', + indicating what flavor of entity the WHO argument specifies. */ +enum __priority_which + { + PRIO_PROCESS = 0, /* WHO is a process ID. */ + PRIO_PGRP = 1, /* WHO is a process group ID. */ + PRIO_USER = 2 /* WHO is a user ID. */ + }; diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/termios.h b/sysdeps/unix/bsd/sun/sunos4/bits/termios.h new file mode 100644 index 0000000..dc0a007 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/termios.h @@ -0,0 +1,208 @@ +/* termios type and macro definitions. SunOS 4 version. + Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Type of terminal control flag masks. */ +typedef unsigned long int tcflag_t; + +/* Type of control characters. */ +typedef unsigned char cc_t; + +/* Type of baud rate specifiers. */ +typedef unsigned int speed_t; + +/* Terminal control structure. */ +struct termios +{ + /* Input modes. */ + tcflag_t c_iflag; +#define IGNBRK 0x0001 /* Ignore break condition. */ +#define BRKINT 0x0002 /* Signal interrupt on break. */ +#define IGNPAR 0x0004 /* Ignore characters with parity errors. */ +#define PARMRK 0x0008 /* Mark parity and framing errors. */ +#define INPCK 0x0010 /* Enable input parity check. */ +#define ISTRIP 0x0020 /* Strip 8th bit off characters. */ +#define INLCR 0x0040 /* Map NL to CR on input. */ +#define IGNCR 0x0080 /* Ignore CR. */ +#define ICRNL 0x0100 /* Map CR to NL on input. */ +#ifdef __USE_BSD +#define IUCLC 0x0200 /* Map upper case to lower case on input. */ +#endif +#define IXON 0x0400 /* Enable start/stop output control. */ +#define IXOFF 0x1000 /* Enable start/stop input control. */ +#ifdef __USE_BSD +#define IXANY 0x0800 /* Any character will restart after stop. */ +#define IMAXBEL 0x2000 /* Ring bell when input queue is full. */ +#endif + + /* Output modes. */ + tcflag_t c_oflag; +#define OPOST 0x0001 /* Perform output processing. */ +#ifdef __USE_BSD +#define OLCUC 0x00000002 /* Map lower case to upper case on output. */ +#define ONLCR 0x00000004 /* Map NL to CR-NL on output. */ +#define OCRNL 0x00000008 +#define ONOCR 0x00000010 +#define ONLRET 0x00000020 +#define OFILL 0x00000040 +#define OFDEL 0x00000080 +#define NLDLY 0x00000100 +#define NL0 0 +#define NL1 0x00000100 +#define CRDLY 0x00000600 +#define CR0 0 +#define CR1 0x00000200 +#define CR2 0x00000400 +#define CR3 0x00000600 +#define TABDLY 0x00001800 +#define TAB0 0 +#define TAB1 0x00000800 +#define TAB2 0x00001000 +#define XTABS 0x00001800 +#define TAB3 XTABS +#define BSDLY 0x00002000 +#define BS0 0 +#define BS1 0x00002000 +#define VTDLY 0x00004000 +#define VT0 0 +#define VT1 0x00004000 +#define FFDLY 0x00008000 +#define FF0 0 +#define FF1 0x00008000 +#define PAGEOUT 0x00010000 +#define WRAP 0x00020000 +#endif + + /* Control modes. */ + tcflag_t c_cflag; +#define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */ +#define CS5 0 /* 5 bits per byte. */ +#define CS6 0x00000010 /* 6 bits per byte. */ +#define CS7 0x00000020 /* 7 bits per byte. */ +#define CS8 0x00000030 /* 8 bits per byte. */ +#define CSTOPB 0x00000040 /* Two stop bits instead of one. */ +#define CREAD 0x00000080 /* Enable receiver. */ +#define PARENB 0x00000100 /* Parity enable. */ +#define PARODD 0x00000200 /* Odd parity instead of even. */ +#define HUPCL 0x00000400 /* Hang up on last close. */ +#define CLOCAL 0x00000800 /* Ignore modem status lines. */ +#ifdef __USE_BSD +#define LOBLK 0x00001000 +#define CRTSCTS 0x80000000 +#define CIBAUD 0x000f0000 /* Mask for input speed from c_cflag. */ +#define CBAUD 0x0000000f /* Mask for output speed from c_cflag. */ +#define IBSHIFT 16 /* Bits to shift for input speed. */ +#endif + + /* Input and output baud rates. These are encoded in c_cflag. */ +#define B0 0 +#define B50 1 +#define B75 2 +#define B110 3 +#define B134 4 +#define B150 5 +#define B200 6 +#define B300 7 +#define B600 8 +#define B1200 9 +#define B1800 10 +#define B2400 11 +#define B4800 12 +#define B9600 13 +#define B19200 14 +#define B38400 15 +#ifdef __USE_BSD +#define EXTA 14 +#define EXTB 15 +#endif + + /* Local modes. */ + tcflag_t c_lflag; +#ifdef __USE_BSD +#define ECHOKE 0x00000800 /* Visual erase for KILL. */ +#endif +#define ECHOE 0x00000010 /* Visual erase for ERASE. */ +#define ECHOK 0x00000020 /* Echo NL after KILL. */ +#define ECHO 0x00000008 /* Enable echo. */ +#define ECHONL 0x00000040 /* Echo NL even if ECHO is off. */ +#ifdef __USE_BSD +#define ECHOPRT 0x00000400 /* Hardcopy visual erase. */ +#define ECHOCTL 0x00000200 /* Echo control characters as ^X. */ +#endif +#define ISIG 0x00000001 /* Enable signals. */ +#define ICANON 0x00000002 /* Do erase and kill processing. */ +#define IEXTEN 0x00008000 /* Enable DISCARD and LNEXT. */ +#define TOSTOP 0x00000100 /* Send SIGTTOU for background output. */ +#ifdef __USE_BSD +#define PENDIN 0x00004000 /* Retype pending input (state). */ +#endif +#define NOFLSH 0x00000080 /* Disable flush after interrupt. */ + + char c_line; /* Line discipline (?) */ + + /* Control characters. */ +#define VEOF 4 /* End-of-file character [ICANON]. */ +#define VEOL 5 /* End-of-line character [ICANON]. */ +#ifdef __USE_BSD +#define VEOL2 6 /* Second EOL character [ICANON]. */ +#define VSWTCH 7 /* ??? */ +#endif +#define VERASE 2 /* Erase character [ICANON]. */ +#ifdef __USE_BSD +#define VWERASE 14 /* Word-erase character [ICANON]. */ +#endif +#define VKILL 3 /* Kill-line character [ICANON]. */ +#ifdef __USE_BSD +#define VREPRINT 12 /* Reprint-line character [ICANON]. */ +#endif +#define VINTR 0 /* Interrupt character [ISIG]. */ +#define VQUIT 1 /* Quit character [ISIG]. */ +#define VSUSP 10 /* Suspend character [ISIG]. */ +#ifdef __USE_BSD +#define VDSUSP 11 /* Delayed suspend character [ISIG]. */ +#endif +#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ +#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ +#ifdef __USE_BSD +#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ +#define VDISCARD 13 /* Discard character [IEXTEN]. */ +#endif +#define VMIN VEOF /* Minimum number of bytes read at once [!ICANON]. */ +#define VTIME VEOL /* Time-out value (tenths of a second) [!ICANON]. */ +#define NCCS 17 + cc_t c_cc[NCCS]; +}; + +#define _IOT_termios /* Hurd ioctl type field. */ \ + _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 /* Change immediately. */ +#define TCSADRAIN 1 /* Change when pending output is written. */ +#define TCSAFLUSH 2 /* Flush pending input before changing. */ + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 0 /* Discard data received but not yet read. */ +#define TCOFLUSH 1 /* Discard data written but not yet sent. */ +#define TCIOFLUSH 2 /* Discard all pending data. */ + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 0 /* Suspend output. */ +#define TCOON 1 /* Restart suspended output. */ +#define TCIOFF 2 /* Send a STOP character. */ +#define TCION 3 /* Send a START character. */ diff --git a/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h b/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h new file mode 100644 index 0000000..e9111b6 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sunos4/bits/utsname.h @@ -0,0 +1,2 @@ +#define _UTSNAME_LENGTH 9 +#define _UTSNAME_NODENAME_LENGTH 65 -- 2.7.4