diff options
Diffstat (limited to 'sysdeps/unix/sysv/sysv4/solaris2')
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/Makefile | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/direct.h | 39 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/fsync.S | 29 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/signum.h | 73 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/sparc/Dist | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile | 5 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/sparc/sys-sig.S | 25 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S | 46 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h | 51 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/statbuf.h | 82 | ||||
-rw-r--r-- | sysdeps/unix/sysv/sysv4/solaris2/utimes.S | 2 |
12 files changed, 363 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/sysv4/solaris2/Makefile b/sysdeps/unix/sysv/sysv4/solaris2/Makefile new file mode 100644 index 0000000000..3f86c46cc8 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/Makefile @@ -0,0 +1,6 @@ +# The linker supplied with Solaris looks in the current directory +# before searching others. Compiling the various programs that come +# along the way (e.g., glue-ctype) will fail because it'll try to link +# with the libc.a being *constructed* in $(objdir). As a work-around, +# we add this to each native-compile. +BUILD_CFLAGS := $(BUILD_CFLAGS) -L/lib diff --git a/sysdeps/unix/sysv/sysv4/solaris2/direct.h b/sysdeps/unix/sysv/sysv4/solaris2/direct.h new file mode 100644 index 0000000000..f9822dcbc5 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/direct.h @@ -0,0 +1,39 @@ +/* Copyright (C) 1992, 1993 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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifndef _BSDDIR_H +#define _BSDDIR_H 1 + +#include <limits.h> + +/* This is the Solaris direct; it's the same as that in + sysdeps/unix/sysv/sysv4/direct.h, but it uses the length given by d_namlen, + since we can't reliably use tyhe sysv4/direct.h method of computing + the length. */ + +struct direct + { + unsigned long int d_fileno; + long int d_off; + unsigned short int d_reclen; + char d_name[NAME_MAX + 1]; + }; + +#define D_NAMLEN(d) (strlen ((d)->d_name)) + +#endif diff --git a/sysdeps/unix/sysv/sysv4/solaris2/fsync.S b/sysdeps/unix/sysv/sysv4/solaris2/fsync.S new file mode 100644 index 0000000000..aefa3e3af7 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/fsync.S @@ -0,0 +1,29 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + +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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> + +/* Solaris uses fdsync for the normal fsync. */ +ENTRY(fsync) + mov 16, %i1 + mov SYS_ify(fdsync), %g1 + ta 8 + bcs syscall_error + nop + mov %g0, %o0 + ret diff --git a/sysdeps/unix/sysv/sysv4/solaris2/signum.h b/sysdeps/unix/sysv/sysv4/solaris2/signum.h new file mode 100644 index 0000000000..8219626c3e --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/signum.h @@ -0,0 +1,73 @@ +/* Signal number definitions. Solaris 2 version. +Copyright (C) 1994 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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifdef _SIGNAL_H + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + + +/* Signals. */ +#define SIGHUP 1 /* Hangup (POSIX). */ +#define SIGINT 2 /* Interrupt (ANSI). */ +#define SIGQUIT 3 /* Quit (POSIX). */ +#define SIGILL 4 /* Illegal instruction (ANSI). */ +#define SIGABRT SIGIOT /* Abort (ANSI). */ +#define SIGTRAP 5 /* Trace trap (POSIX). */ +#define SIGIOT 6 /* IOT trap (4.2 BSD). */ +#define SIGEMT 7 /* EMT trap (4.2 BSD). */ +#define SIGFPE 8 /* Floating-point exception (ANSI). */ +#define SIGKILL 9 /* Kill, unblockable (POSIX). */ +#define SIGBUS 10 /* Bus error (4.2 BSD). */ +#define SIGSEGV 11 /* Segmentation violation (ANSI). */ +#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/ +#define SIGPIPE 13 /* Broken pipe (POSIX). */ +#define SIGALRM 14 /* Alarm clock (POSIX). */ +#define SIGTERM 15 /* Termination (ANSI). */ +#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */ +#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */ +#define SIGCHLD 18 /* Child status has changed (POSIX). */ +#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ +#define SIGPWR 19 /* Power failure restart (System V). */ +#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */ +#define SIGURG 21 /* Urgent condition on socket (4.2 BSD).*/ +#define SIGPOLL 22 /* Pollable event occurred (System V). */ +#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ +#define SIGSTOP 23 /* Stop, unblockable (POSIX). */ +#define SIGTSTP 24 /* Keyboard stop (POSIX). */ +#define SIGCONT 25 /* Continue (POSIX). */ +#define SIGTTIN 26 /* Background read from tty (POSIX). */ +#define SIGTTOU 27 /* Background write to tty (POSIX). */ +#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */ +#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */ +#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */ +#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */ +/* The following signals are new in Solaris 2. */ +#define SIGWAITING 32 /* Process's lwps are blocked. */ +#define SIGLWP 33 /* Special signal used by thread library. */ +#define SIGFREEZE 34 /* Special signal used by CPR. */ +#define SIGTHAW 35 /* Special signal used by CPR. */ +#define _SIGRTMIN 36 /* First (highest-priority) realtime signal. */ +#define _SIGRTMAX 43 /* Last (lowest-priority) realtime signal. */ + +#endif /* <signal.h> included. */ + +#define _NSIG 44 /* Biggest signal number + 1. */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/Dist b/sysdeps/unix/sysv/sysv4/solaris2/sparc/Dist new file mode 100644 index 0000000000..69d16ac6bf --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/Dist @@ -0,0 +1 @@ +sys-sig.S diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile b/sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile new file mode 100644 index 0000000000..7ad4bb1633 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile @@ -0,0 +1,5 @@ +# This flag is necessary because GCC now tries to call _Q_{mul, etc...} +# instead of doing the stuff the hard way. For now, printf_fp.o, __vfscanf.o, +# and difftime.o don't work because of this. The long-term fix is to actually +# implement what they're doing, but for the short-term, we must do this. +sysdep-CFLAGS := $(sysdep-CFLAGS) -mhard-quad-float diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c b/sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c new file mode 100644 index 0000000000..afdfaaa2e5 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c @@ -0,0 +1,4 @@ +#define NO_SHLIB +/* Solaris needs start named `_start', not `start'. */ +#define NO_EXPLICIT_START +#include <sysdeps/unix/sparc/start.c> diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys-sig.S b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys-sig.S new file mode 100644 index 0000000000..8baa997e80 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys-sig.S @@ -0,0 +1,25 @@ +/* Copyright (C) 1994 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + +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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> + +PSEUDO (__sigaction_syscall, sigaction, 3) + ret + +PSEUDO (__context_syscall, context, 2) + ret diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S new file mode 100644 index 0000000000..da3cd6b8be --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S @@ -0,0 +1,46 @@ +/* Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + +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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> +#define _ERRNO_H +#include <errnos.h> + +ENTRY(syscall_error) + /* If it was a syscall that got interrupted, but can + be restarted, drop EINTR in. */ + cmp %o0, ERESTART + be,a notint + mov EINTR, %o0 + +notint: +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN + /* We translate the system's EWOULDBLOCK error into EAGAIN. + The GNU C library always defines EWOULDBLOCK==EAGAIN. + EWOULDBLOCK_sys is the original number. */ + cmp %o0, EWOULDBLOCK_sys + be,a notblock + mov EAGAIN, %o0 +#endif + +notblock:/* Store it in errno... */ + sethi %hi(C_SYMBOL_NAME(errno)), %g1 + st %o0, [%g1 + %lo(C_SYMBOL_NAME(errno))] + + /* And just kick back a -1. */ + retl + mov -1, %o0 diff --git a/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h new file mode 100644 index 0000000000..edb98309e6 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h @@ -0,0 +1,51 @@ +/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + +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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +/* Solaris 2 does not precede the asm names of C symbols with a `_'. */ +#define NO_UNDERSCORES + +#include <sysdeps/unix/sysdep.h> + +#ifdef ASSEMBLER + +/* As of gcc-2.6.0, it complains about pound signs in front of things + that aren't arguments to the macro. So we use this to pull it off + instead. */ +#define cat(a,b) a##b +#define poundfnc cat(#,function) + +#define ENTRY(name) \ + .section ".text"; \ + .align 4; \ + .global C_SYMBOL_NAME(name); \ + .type C_SYMBOL_NAME(name), poundfnc; \ + C_LABEL(name) + +#define PSEUDO(name, syscall_name, args) \ + ENTRY (name) \ + mov SYS_ify(syscall_name), %g1; \ + ta 8; \ + bcs C_SYMBOL_NAME(syscall_error); \ + nop + +#define ret retl; nop +#define r0 %o0 +#define r1 %o1 +#define MOVE(x,y) mov x, y + +#endif /* ASSEMBLER */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/statbuf.h b/sysdeps/unix/sysv/sysv4/solaris2/statbuf.h new file mode 100644 index 0000000000..ac74cdffa7 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/statbuf.h @@ -0,0 +1,82 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. + Contributed by Brendan Kehoe (brendan@zen.org). + +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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifndef _STATBUF_H +#define _STATBUF_H + +#include <gnu/types.h> + +/* Structure describing file characteristics. */ +struct stat + { + unsigned long int st_dev; + long st_filler1[3]; + __ino_t st_ino; /* File serial number. */ + unsigned long int st_mode; /* File mode. */ + /* This is unsigned long instead of __nlink_t, since SVR4 has + a long nlink_t, not a short one. */ + unsigned long int st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned long int st_rdev; /* Device number, if device. */ + long st_filler2[2]; + + __off_t st_size; /* Size of file, in bytes. */ + /* SVR4 added this extra long to allow for expansion of off_t. */ + long st_filler3; + + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atime_usec; + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtime_usec; + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctime_usec; + + long st_blksize; /* Optimal block size for I/O. */ +#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */ + + long st_blocks; /* Number of 512-byte blocks allocated. */ + char st_fstype[16]; + long st_filler4[8]; + }; + +/* Encoding of the file mode. */ + +#define __S_IFMT 0170000 /* These bits determine file type. */ + +/* File types. */ +#define __S_IFDIR 0040000 /* Directory. */ +#define __S_IFCHR 0020000 /* Character device. */ +#define __S_IFBLK 0060000 /* Block device. */ +#define __S_IFREG 0100000 /* Regular file. */ +#define __S_IFIFO 0010000 /* FIFO. */ + +/* These don't actually exist on System V, but having them doesn't hurt. */ +#define __S_IFLNK 0120000 /* Symbolic link. */ +#define __S_IFSOCK 0140000 /* Socket. */ + +/* Protection bits. */ + +#define __S_ISUID 04000 /* Set user ID on execution. */ +#define __S_ISGID 02000 /* Set group ID on execution. */ +#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ +#define __S_IREAD 0400 /* Read by owner. */ +#define __S_IWRITE 0200 /* Write by owner. */ +#define __S_IEXEC 0100 /* Execute by owner. */ + +#endif /* statbuf.h */ diff --git a/sysdeps/unix/sysv/sysv4/solaris2/utimes.S b/sysdeps/unix/sysv/sysv4/solaris2/utimes.S new file mode 100644 index 0000000000..54a043c835 --- /dev/null +++ b/sysdeps/unix/sysv/sysv4/solaris2/utimes.S @@ -0,0 +1,2 @@ +/* Solaris has the BSD `utimes' function. */ +#include <sysdeps/unix/bsd/utimes.S> |