Document new files for Linux i386/ELF port.

Fri Sep  8 16:32:12 1995  Ulrich Drepper  <drepper@gnu.ai.mit.edu>

        * sysdeps/unix/sysv/linux/Implies,
        sysdeps/unix/sysv/linux/Makefile, sysdeps/unix/sysv/linux/Subdirs,
        sysdeps/unix/sysv/linux/accept.S, sysdeps/unix/sysv/linux/adjtime.c,
        sysdeps/unix/sysv/linux/adjtimex.S, sysdeps/unix/sysv/linux/bind.S,
        sysdeps/unix/sysv/linux/connect.S, sysdeps/unix/sysv/linux/direct.h,
        sysdeps/unix/sysv/linux/dl-machine.h, sysdeps/unix/sysv/linux/errnos.h,
        sysdeps/unix/sysv/linux/fork.S, sysdeps/unix/sysv/linux/gethostid.c,
        sysdeps/unix/sysv/linux/gethostname.C,
        sysdeps/unix/sysv/linux/getpeername.S,
        sysdeps/unix/sysv/linux/getpgid.S, sysdeps/unix/sysv/linux/getpgrp.S,
	sysdeps/unix/sysv/linux/getsockname.S,
	sysdeps/unix/sysv/linux/getsockopt.S, sysdeps/unix/sysv/linux/gtty.S,
	sysdeps/unix/sysv/linux/listen.S, sysdeps/unix/sysv/linux/local_lim.h,
	sysdeps/unix/sysv/linux/madvise.c, sysdeps/unix/sysv/linux/msgctl.c,
	sysdeps/unix/sysv/linux/msgget.c, sysdeps/unix/sysv/linux/msgrcv.c,
	sysdeps/unix/sysv/linux/msgsnd.c, sysdeps/unix/sysv/linux/pipe.S,
	sysdeps/unix/sysv/linux/poll.c, sysdeps/unix/sysv/linux/readv.c,
	sysdeps/unix/sysv/linux/recv.S, sysdeps/unix/sysv/linux/recvfrom.S,
	sysdeps/unix/sysv/linux/recvmsg.S, sysdeps/unix/sysv/linux/semctl.c,
	sysdeps/unix/sysv/linux/semget.c, sysdeps/unix/sysv/linux/semop.c,
	sysdeps/unix/sysv/linux/send.S, sysdeps/unix/sysv/linux/sendmsg.S,
	sysdeps/unix/sysv/linux/sendto.S, sysdeps/unix/sysv/linux/setegid.c,
	sysdeps/unix/sysv/linux/seteuid.c, sysdeps/unix/sysv/linux/sethostid.c,
	sysdeps/unix/sysv/linux/setpgid.c, sysdeps/unix/sysv/linux/setpgrp.c,
	sysdeps/unix/sysv/linux/setsid.S, sysdeps/unix/sysv/linux/setsockopt.S,
	sysdeps/unix/sysv/linux/settimeofday.S,
	sysdeps/unix/sysv/linux/shmat.c, sysdeps/unix/sysv/linux/shmctl.c,
	sysdeps/unix/sysv/linux/shmdt.c, sysdeps/unix/sysv/linux/shmget.c,
	sysdeps/unix/sysv/linux/shutdown.S,
	sysdeps/unix/sysv/linux/sigaction.S, sysdeps/unix/sysv/linux/signal.S,
	sysdeps/unix/sysv/linux/sigpending.S, sysdeps/unix/sysv/linux/sigset.h,
	sysdeps/unix/sysv/linux/sockaddrcom.h,
	sysdeps/unix/sysv/linux/socketpair.S, sysdeps/unix/sysv/linux/speed.c,
	sysdeps/unix/sysv/linux/statbuf.h, sysdeps/unix/sysv/linux/stty.S,
	sysdeps/unix/sysv/linux/syscall.h, sysdeps/unix/sysv/linux/sysconf.c,
	sysdeps/unix/sysv/linux/tcdrain.c, sysdeps/unix/sysv/linux/tcflow.c,
	sysdeps/unix/sysv/linux/tcflush.c, sysdeps/unix/sysv/linux/tcgetattr.c,
	sysdeps/unix/sysv/linux/tcsetattr.c,
	sysdeps/unix/sysv/linux/termbits.h, sysdeps/unix/sysv/linux/ualarm.c,
	sysdeps/unix/sysv/linux/ulimit.c, sysdeps/unix/sysv/linux/usleep.c,
	sysdeps/unix/sysv/linux/utsnamelen.h, sysdeps/unix/sysv/linux/vfork.c,
	sysdeps/unix/sysv/linux/wait.c, sysdeps/unix/sysv/linux/wait4.S,
	sysdeps/unix/sysv/linux/waitpid.c, sysdeps/unix/sysv/linux/writev.c:
	New Linux/ELF specific, architecture independent files.

	sysdeps/unix/sysv/linux/i386/Dist,
	sysdeps/unix/sysv/linux/i386/Makefile,
	sysdeps/unix/sysv/linux/i386/brk.S,
	sysdeps/unix/sysv/linux/i386/fcntlbits.h,
	sysdeps/unix/sysv/linux/i386/fpu_control.c,
	sysdeps/unix/sysv/linux/i386/fpu_control.h,
	sysdeps/unix/sysv/linux/i386/fstat.S,
	sysdeps/unix/sysv/linux/i386/fxstat.S,
	sysdeps/unix/sysv/linux/i386/ieee_fpu.c,
	sysdeps/unix/sysv/linux/i386/init-first.S,
	sysdeps/unix/sysv/linux/i386/ipc.S,
	sysdeps/unix/sysv/linux/i386/lstat.S,
	sysdeps/unix/sysv/linux/i386/lxstat.S,
	sysdeps/unix/sysv/linux/i386/mknod.S,
	sysdeps/unix/sysv/linux/i386/mmap.S,
	sysdeps/unix/sysv/linux/i386/sbrk.S,
	sysdeps/unix/sysv/linux/i386/setfpucw.c,
	sysdeps/unix/sysv/linux/i386/signum.h,
	sysdeps/unix/sysv/linux/i386/socket.S,
	sysdeps/unix/sysv/linux/i386/stat.S,
	sysdeps/unix/sysv/linux/i386/syscall.S,
	sysdeps/unix/sysv/linux/i386/sysdep.S,
	sysdeps/unix/sysv/linux/i386/sysdep.h,
	sysdeps/unix/sysv/linux/i386/xmknod.S,
	sysdeps/unix/sysv/linux/i386/xstat.S:
	New Linux i386/ELF specific files.

	sysdeps/unix/sysv/linux/sys/ipc_buf.h,
	sysdeps/unix/sysv/linux/sys/mman.h,
	sysdeps/unix/sysv/linux/sys/msq_buf.h,
	sysdeps/unix/sysv/linux/sys/sem_buf.h,
	sysdeps/unix/sysv/linux/sys/shm_buf.h,
	sysdeps/unix/sysv/linux/sys/socketcall.h,
	sysdeps/unix/sysv/linux/sys/timex.h:
	New Linux/ELF specific, architecture independent header files.
This commit is contained in:
Ulrich Drepper 1995-09-08 17:02:25 +00:00
parent d586354e51
commit d2f5be2a12
113 changed files with 3339 additions and 94 deletions

View file

@ -1,3 +1,86 @@
Fri Sep 8 16:32:12 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/Implies,
sysdeps/unix/sysv/linux/Makefile, sysdeps/unix/sysv/linux/Subdirs,
sysdeps/unix/sysv/linux/accept.S, sysdeps/unix/sysv/linux/adjtime.c,
sysdeps/unix/sysv/linux/adjtimex.S, sysdeps/unix/sysv/linux/bind.S,
sysdeps/unix/sysv/linux/connect.S, sysdeps/unix/sysv/linux/direct.h,
sysdeps/unix/sysv/linux/dl-machine.h, sysdeps/unix/sysv/linux/errnos.h,
sysdeps/unix/sysv/linux/fork.S, sysdeps/unix/sysv/linux/gethostid.c,
sysdeps/unix/sysv/linux/gethostname.C,
sysdeps/unix/sysv/linux/getpeername.S,
sysdeps/unix/sysv/linux/getpgid.S, sysdeps/unix/sysv/linux/getpgrp.S,
sysdeps/unix/sysv/linux/getsockname.S,
sysdeps/unix/sysv/linux/getsockopt.S, sysdeps/unix/sysv/linux/gtty.S,
sysdeps/unix/sysv/linux/listen.S, sysdeps/unix/sysv/linux/local_lim.h,
sysdeps/unix/sysv/linux/madvise.c, sysdeps/unix/sysv/linux/msgctl.c,
sysdeps/unix/sysv/linux/msgget.c, sysdeps/unix/sysv/linux/msgrcv.c,
sysdeps/unix/sysv/linux/msgsnd.c, sysdeps/unix/sysv/linux/pipe.S,
sysdeps/unix/sysv/linux/poll.c, sysdeps/unix/sysv/linux/readv.c,
sysdeps/unix/sysv/linux/recv.S, sysdeps/unix/sysv/linux/recvfrom.S,
sysdeps/unix/sysv/linux/recvmsg.S, sysdeps/unix/sysv/linux/semctl.c,
sysdeps/unix/sysv/linux/semget.c, sysdeps/unix/sysv/linux/semop.c,
sysdeps/unix/sysv/linux/send.S, sysdeps/unix/sysv/linux/sendmsg.S,
sysdeps/unix/sysv/linux/sendto.S, sysdeps/unix/sysv/linux/setegid.c,
sysdeps/unix/sysv/linux/seteuid.c, sysdeps/unix/sysv/linux/sethostid.c,
sysdeps/unix/sysv/linux/setpgid.c, sysdeps/unix/sysv/linux/setpgrp.c,
sysdeps/unix/sysv/linux/setsid.S, sysdeps/unix/sysv/linux/setsockopt.S,
sysdeps/unix/sysv/linux/settimeofday.S,
sysdeps/unix/sysv/linux/shmat.c, sysdeps/unix/sysv/linux/shmctl.c,
sysdeps/unix/sysv/linux/shmdt.c, sysdeps/unix/sysv/linux/shmget.c,
sysdeps/unix/sysv/linux/shutdown.S,
sysdeps/unix/sysv/linux/sigaction.S, sysdeps/unix/sysv/linux/signal.S,
sysdeps/unix/sysv/linux/sigpending.S, sysdeps/unix/sysv/linux/sigset.h,
sysdeps/unix/sysv/linux/sockaddrcom.h,
sysdeps/unix/sysv/linux/socketpair.S, sysdeps/unix/sysv/linux/speed.c,
sysdeps/unix/sysv/linux/statbuf.h, sysdeps/unix/sysv/linux/stty.S,
sysdeps/unix/sysv/linux/syscall.h, sysdeps/unix/sysv/linux/sysconf.c,
sysdeps/unix/sysv/linux/tcdrain.c, sysdeps/unix/sysv/linux/tcflow.c,
sysdeps/unix/sysv/linux/tcflush.c, sysdeps/unix/sysv/linux/tcgetattr.c,
sysdeps/unix/sysv/linux/tcsetattr.c,
sysdeps/unix/sysv/linux/termbits.h, sysdeps/unix/sysv/linux/ualarm.c,
sysdeps/unix/sysv/linux/ulimit.c, sysdeps/unix/sysv/linux/usleep.c,
sysdeps/unix/sysv/linux/utsnamelen.h, sysdeps/unix/sysv/linux/vfork.c,
sysdeps/unix/sysv/linux/wait.c, sysdeps/unix/sysv/linux/wait4.S,
sysdeps/unix/sysv/linux/waitpid.c, sysdeps/unix/sysv/linux/writev.c:
New Linux/ELF specific, architecture independent files.
sysdeps/unix/sysv/linux/i386/Dist,
sysdeps/unix/sysv/linux/i386/Makefile,
sysdeps/unix/sysv/linux/i386/brk.S,
sysdeps/unix/sysv/linux/i386/fcntlbits.h,
sysdeps/unix/sysv/linux/i386/fpu_control.c,
sysdeps/unix/sysv/linux/i386/fpu_control.h,
sysdeps/unix/sysv/linux/i386/fstat.S,
sysdeps/unix/sysv/linux/i386/fxstat.S,
sysdeps/unix/sysv/linux/i386/ieee_fpu.c,
sysdeps/unix/sysv/linux/i386/init-first.S,
sysdeps/unix/sysv/linux/i386/ipc.S,
sysdeps/unix/sysv/linux/i386/lstat.S,
sysdeps/unix/sysv/linux/i386/lxstat.S,
sysdeps/unix/sysv/linux/i386/mknod.S,
sysdeps/unix/sysv/linux/i386/mmap.S,
sysdeps/unix/sysv/linux/i386/sbrk.S,
sysdeps/unix/sysv/linux/i386/setfpucw.c,
sysdeps/unix/sysv/linux/i386/signum.h,
sysdeps/unix/sysv/linux/i386/socket.S,
sysdeps/unix/sysv/linux/i386/stat.S,
sysdeps/unix/sysv/linux/i386/syscall.S,
sysdeps/unix/sysv/linux/i386/sysdep.S,
sysdeps/unix/sysv/linux/i386/sysdep.h,
sysdeps/unix/sysv/linux/i386/xmknod.S,
sysdeps/unix/sysv/linux/i386/xstat.S:
New Linux i386/ELF specific files.
sysdeps/unix/sysv/linux/sys/ipc_buf.h,
sysdeps/unix/sysv/linux/sys/mman.h,
sysdeps/unix/sysv/linux/sys/msq_buf.h,
sysdeps/unix/sysv/linux/sys/sem_buf.h,
sysdeps/unix/sysv/linux/sys/shm_buf.h,
sysdeps/unix/sysv/linux/sys/socketcall.h,
sysdeps/unix/sysv/linux/sys/timex.h:
New Linux/ELF specific, architecture independent header files.
Wed Sep 6 19:41:10 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* elf/dl-lookup.c (_dl_lookup_symbol): Test WEAK_VALUE.s rather

View file

@ -0,0 +1,7 @@
# Linux has not yet (as of 1.3.18) the canonical set of <sys/mman.h>
# system calls. msync() and madvice() are missing, so their stubs
# are found here. I think later version will have them ones.
unix/mman
# Linux has network support in the kernel.
unix/inet

View file

@ -0,0 +1,21 @@
ifeq ($(subdir), io)
sysdep_routines := $(sysdep_routines) fxstat lxstat xstat
endif
ifeq ($(subdir), misc)
sysdep_routines := $(sysdep_routines) xmknod
endif
#ifeq ($(subdir), posix)
#sysdep_routines := $(sysdep_routines) setpgrp
#endif
ifeq ($(subdir), time)
sysdep_routines := $(sysdep_routines) adjtimex
endif
ifeq ($(subdir), sysvipc)
sysdep_routines := $(sysdep_routines) ipc
endif
headers := $(headers) sys/socketcall.h sys/timex.h

View file

@ -0,0 +1 @@
sysvipc

View file

@ -0,0 +1,69 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
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. */
#include <errno.h>
#include <limits.h>
#include <sys/time.h>
#include <sys/timex.h>
#define MAX_SEC (LONG_MAX / 1000000L - 2)
#define MIN_SEC (LONG_MIN / 1000000L + 2)
int
__adjtime (itv, otv)
const struct timeval *itv;
struct timeval *otv;
{
struct timex tntx;
if (itv)
{
struct timeval tmp;
/* We will do some check here. */
tmp.tv_sec = itv->tv_sec + itv->tv_usec / 1000000L;
tmp.tv_usec = itv->tv_usec % 1000000L;
if (tmp.tv_sec > MAX_SEC || tmp.tv_sec < MIN_SEC)
{
errno = EINVAL;
return -1;
}
tntx.offset = tmp.tv_usec + tmp.tv_sec * 1000000L;
tntx.mode = ADJ_OFFSET_SINGLESHOT;
}
else
tntx.mode = 0;
if (__adjtimex (&tntx) < 0) return -1;
if (otv)
{
if (tntx.offset < 0)
{
otv->tv_usec = -(-tntx.offset % 1000000);
otv->tv_sec = -(-tntx.offset / 1000000);
}
else
{
otv->tv_usec = tntx.offset % 1000000;
otv->tv_sec = tntx.offset / 1000000;
}
}
return 0;
}
weak_alias (__adjtime, adjtime)

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL__ (adjtimex, 1)
ret

View file

@ -0,0 +1,43 @@
/* 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 what system V calls a "struct dirent". */
struct direct
{
unsigned long int d_fileno;
long int d_off;
unsigned short int d_reclen;
char d_name[NAME_MAX + 1];
};
#include <stddef.h>
/* We calculate the length of the name by taking the length of the whole
`struct direct' record, subtracting the size of everything before the
name, and subtracting one for the terminating null. */
#define D_NAMLEN(d) \
((d)->d_reclen - offsetof (struct direct, d_name) - 1)
#endif

View file

@ -0,0 +1,214 @@
/* Machine-dependent ELF dynamic relocation inline functions.
i386/Linux version.
Copyright (C) 1995 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. */
#define ELF_MACHINE_NAME "i386"
#include <assert.h>
#include <string.h>
#include <link.h>
#include <syscall.h>
#include <sys/mman.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
{
switch (e_machine)
{
case EM_386:
case EM_486:
return 1;
default:
return 0;
}
}
/* Return the run-time address of the _GLOBAL_OFFSET_TABLE_.
Must be inlined in a function which uses global data. */
static inline Elf32_Addr *
elf_machine_got (void)
{
register Elf32_Addr *got asm ("%ebx");
return got;
}
/* Return the run-time load address of the shared object. */
static inline Elf32_Addr
elf_machine_load_address (void)
{
Elf32_Addr addr;
asm (" call here\n"
"here: popl %0\n"
" subl $here, %0"
: "=r" (addr));
return addr;
}
/* The `subl' insn above will contain an R_386_32 relocation entry
intended to insert the run-time address of the label `here'.
This will be the first relocation in the text of the dynamic linker;
we skip it to avoid trying to modify read-only text in this early stage. */
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
++(const Elf32_Rel *) (dynamic_info)[DT_REL]->d_un.d_ptr; \
(dynamic_info)[DT_RELSZ]->d_un.d_val -= sizeof (Elf32_Rel)
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
MAP is the object containing the reloc. */
static inline void
elf_machine_rel (struct link_map *map,
const Elf32_Rel *reloc,
Elf32_Addr sym_loadaddr, const Elf32_Sym *sym)
{
Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset);
const Elf32_Addr sym_value = sym_loadaddr + sym->st_value;
switch (ELF32_R_TYPE (reloc->r_info))
{
case R_386_COPY:
memcpy (reloc_addr, (void *) sym_value, sym->st_size);
break;
case R_386_GLOB_DAT:
case R_386_JMP_SLOT:
*reloc_addr = sym_value;
break;
case R_386_32:
if (map->l_type == lt_interpreter)
{
/* Undo the relocation done here during bootstrapping. Now we will
relocate it anew, possibly using a binding found in the user
program or a loaded library rather than the dynamic linker's
built-in definitions used while loading those libraries. */
const Elf32_Sym *const dlsymtab
= (void *) (map->l_addr + map->l_info[DT_SYMTAB]->d_un.d_ptr);
*reloc_addr -= (map->l_addr +
dlsymtab[ELF32_R_SYM (reloc->r_info)].st_value);
}
*reloc_addr += sym_value;
break;
case R_386_RELATIVE:
if (map->l_type != lt_interpreter) /* Already done in dynamic linker. */
*reloc_addr += map->l_addr;
break;
case R_386_PC32:
*reloc_addr = sym_value - (Elf32_Addr) reloc_addr;
break;
default:
assert (! "unexpected dynamic reloc type");
break;
}
}
static inline void
elf_machine_lazy_rel (struct link_map *map, const Elf32_Rel *reloc)
{
Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset);
switch (ELF32_R_TYPE (reloc->r_info))
{
case R_386_JMP_SLOT:
*reloc_addr += map->l_addr;
break;
default:
assert (! "unexpected PLT reloc type");
break;
}
}
/* The i386 never uses Elf32_Rela relocations. */
#define ELF_MACHINE_NO_RELA 1
/* Set up the loaded object described by L so its unrelocated PLT
entries will jump to the on-demand fixup code in dl-runtime.c. */
static inline void
elf_machine_runtime_setup (struct link_map *l)
{
Elf32_Addr *got;
extern void _dl_runtime_resolve (Elf32_Word);
/* The GOT entries for functions in the PLT have not yet been filled
in. Their initial contents will arrange when called to push an
offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1],
and then jump to _GLOBAL_OFFSET_TABLE[2]. */
got = (Elf32_Addr *) (l->l_addr + l->l_info[DT_PLTGOT]->d_un.d_ptr);
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
/* This function will get called to fix up the GOT entry indicated by
the offset on the stack, and then jump to the resolved address. */
got[2] = (Elf32_Addr) &_dl_runtime_resolve;
}
/* Mask identifying addresses reserved for the user program,
where the dynamic linker should not map anything. */
#define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
#define RTLD_START asm ("\
.text\n\
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
call _dl_start\n\
_dl_start_user:\n\
# Save the user entry point address in %edi.\n\
movl %eax, %edi\n\
# Point %ebx at the GOT.
call 0f\n\
0: popl %ebx\n\
addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx\n\
# See if we were run as a command with the executable file\n\
# name as an extra leading argument.\n\
movl rtld_command@GOT(%ebx), %eax\n\
movl (%eax),%eax\n\
testl %eax,%eax\n\
jz 0f\n\
# Pop the original argument count, decrement it, and replace\n\
# the original first argument pointer with the new count.\n\
popl %eax\n\
decl %eax\n\
movl %eax,(%esp)\n\
# Call _dl_init_next to return the address of an initializer\n\
# function to run.\n\
0: call _dl_init_next@PLT\n\
# Check for zero return, when out of initializers.\n\
testl %eax,%eax\n\
jz 1f\n\
# Call the shared object initializer function.\n\
# NOTE: We depend only on the registers (%ebx and %edi)\n\
# and the return address pushed by this call;\n\
# the initializer is called with the stack just\n\
# as it appears on entry, and it is free to move\n\
# the stack around, as long as it winds up jumping to\n\
# the return address on the top of the stack.\n\
call *%eax\n\
# Loop to call _dl_init_next for the next initializer.\n\
jmp 0b\n\
1: # Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
movl _dl_fini@GOT(%ebx), %edx\n\
# Jump to the user's entry point.\n\
jmp *%edi\n\
");

View file

@ -0,0 +1 @@
#include <linux/errno.h>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1994, 1995 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
@ -18,7 +18,7 @@ Cambridge, MA 02139, USA. */
#include <sysdep.h>
SYSCALL__ (waitpid, 3)
SYSCALL__ (fork, 0)
ret
weak_alias (__waitpid, waitpid)
weak_alias (__fork, fork)

View file

@ -0,0 +1,96 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
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. */
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#define HOSTIDFILE "/var/adm/hostid"
#ifdef SET_PROCEDURE
int
sethostid (id)
long int id;
{
int fd;
ssize_t written;
/* Test for appropriate rights to set host ID. */
if (geteuid () || getuid ())
{
errno = EPERM;
return -1;
}
/* Open file for writing. Everybody is allowed to read this file. */
fd = __open (HOSTIDFILE, O_CREAT|O_WRONLY, 0644);
if (fd < 0)
return -1;
written = __write (fd, &id, sizeof (id));
__close (fd);
return written != sizeof (id) ? -1 : 0;
}
#else
# include <sys/param.h>
# include <resolv/netdb.h>
# include <netinet/in.h>
long int
gethostid ()
{
char hostname[MAXHOSTNAMELEN + 1];
struct hostent *hp;
unsigned long id;
struct in_addr in;
int fd;
/* First try to get the ID from a former invocation of sethostid. */
fd = __open (HOSTIDFILE, O_RDONLY);
if (fd >= 0)
{
ssize_t n = __read (fd, &id, sizeof (id));
__close (fd);
if (n == sizeof (id))
return id;
}
/* Getting from the file was not succesful. An intelligent guess for
a unique number of a host is its IP address. Return this. */
if (gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
/* This also fails. Return and arbitrary value. */
return 0;
/* To get the IP address we need to knoe the host name. */
hp = gethostbyname (hostname);
if (hp == NULL)
return 0;
in.s_addr = 0;
memcpy (&in, hp->h_addr,
sizeof (in) < hp->h_length ? sizeof (in) : hp->h_length);
/* For the return value to be not exactly the IP address we do some
bit fiddling. */
return in.s_addr << 16 | in.s_addr >> 16;
}
#endif

View file

@ -0,0 +1,53 @@
/* Copyright (C) 1992, 1995 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. */
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/utsname.h>
/* Put the name of the current host in no more than LEN bytes of NAME.
The result is null-terminated if LEN is large enough for the full
name and the terminator. */
int
__gethostname (name, len)
char *name;
size_t len;
{
struct utsname buf;
if (name == NULL)
{
errno = EINVAL;
return -1;
}
if (uname (&buf))
return -1;
if (strlen (buf.nodename) + 1 > len)
{
errno = EINVAL;
return -1;
}
strcpy (name, buf.nodename);
return 0;
}
weak_alias (__gethostname, gethostname)

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL (getpgid, 1)
ret

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL (getpgrp, 0)
ret

View file

@ -0,0 +1,2 @@
#define socket getsockopt
#include <socket.S>

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL (gtty, 2)
ret

View file

@ -0,0 +1 @@
fxstat.S lxstat.S xmknod.S xstat.S

View file

@ -0,0 +1,7 @@
ifeq ($(subdir), misc)
sysdep_routines := $(sysdep_routines) fpu_control setfpucw
extra-libs := $(extra-libs) libieee
libieee-routines := ieee_fpu
libieee-inhibit-o := .so .po
endif

View file

@ -0,0 +1,60 @@
/* Copyright (C) 1991, 1992, 1993, 1995 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. */
#include <sysdep.h>
.data
.globl C_SYMBOL_NAME(__curbrk)
C_LABEL(__curbrk)
#ifdef PIC
.long 0
#else
# ifdef HAVE_GNU_LD
.long C_SYMBOL_NAME(_end)
# else
.long C_SYMBOL_NAME(end)
# endif
#endif
.text
.globl C_SYMBOL_NAME(syscall_error)
ENTRY (__brk)
movl %ebx, %edx
movl $SYS_ify(brk), %eax
movl 4(%esp), %ebx
int $0x80
movl %edx, %ebx
cmpl 4(%esp), %eax
jne JUMPTARGET(syscall_error)
#ifdef PIC
/* Standard PIC nonsense to store into `__curbrk' through the GOT. */
call here
here: popl %ecx
addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx
movl C_SYMBOL_NAME(__curbrk@GOT)(%ecx), %ecx
movl %eax, (%ecx)
#else
movl %eax, C_SYMBOL_NAME(__curbrk)
#endif
xorl %eax, %eax
ret
weak_alias (__brk, brk)

View file

@ -0,0 +1,26 @@
/* O_*, F_*, FD_* bit values for Linux.
Copyright (C) 1995 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 _FCNTLBITS_H
#define _FCNTLBITS_H 1
#include <sys/types.h>
#include <linux/fcntl.h>
#endif /* fcntlbits.h */

View file

@ -0,0 +1,20 @@
/* Default control word for ix86 FPU.
Copyright (C) 1995 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. */
unsigned short ___fpu_control = 0;

View file

@ -0,0 +1,100 @@
/* Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe.
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 _FPU_CONTROL_H
#define _FPU_CONTROL_H
/* Here is the dirty part. Settup up your 387 through the control word
* (cw) register.
*
* 15-13 12 11-10 9-8 7-6 5 4 3 2 1 0
* | reserved | IC | RC | PC | reserved | PM | UM | OM | ZM | DM | IM
*
* IM: Invalid operation mask
* DM: Denormalized operand mask
* ZM: Zero-divide mask
* OM: Overflow mask
* UM: Underflow mask
* PM: Precision (inexact result) mask
*
* Mask bit is 1 means no interrupt.
*
* PC: Precision control
* 11 - round to extended precision
* 10 - round to double precision
* 00 - round to single precision
*
* RC: Rounding control
* 00 - rounding to nearest
* 01 - rounding down (toward - infinity)
* 10 - rounding up (toward + infinity)
* 11 - rounding toward zero
*
* IC: Infinity control
* That is for 8087 and 80287 only.
*
* The hardware default is 0x037f. I choose 0x1372.
*/
#include <features.h>
/* masking of interrupts */
#define _FPU_MASK_IM 0x01
#define _FPU_MASK_DM 0x02
#define _FPU_MASK_ZM 0x04
#define _FPU_MASK_OM 0x08
#define _FPU_MASK_UM 0x10
#define _FPU_MASK_PM 0x20
/* precision control */
#define _FPU_EXTENDED 0x300 /* RECOMMENDED */
#define _FPU_DOUBLE 0x200
#define _FPU_SINGLE 0x0 /* DO NOT USE */
/* rounding control */
#define _FPU_RC_NEAREST 0x0 /* RECOMMENDED */
#define _FPU_RC_DOWN 0x400
#define _FPU_RC_UP 0x800
#define _FPU_RC_ZERO 0xC00
#define _FPU_RESERVED 0xF0C0 /* Reserved bits in cw */
/* Now two recommended cw */
/* Linux default:
- extended precision
- rounding to nearest
- exceptions on overflow, zero divide and NaN */
#define _FPU_DEFAULT 0x1372
/* IEEE: same as above, but exceptions */
#define _FPU_IEEE 0x137f
/* private namespace. It should only be used in init-first.o. */
extern unsigned short __fpu_control;
__BEGIN_DECLS
/* called in init-first.o. It can be used to manipulate 387 control word. */
extern void __setfpucw __P ((unsigned short));
__END_DECLS
#endif /* fpu_control.h */

View file

@ -0,0 +1,4 @@
#define __stat __fstat
#define stat fstat
#define __xstat __fxstat
#include "stat.S"

View file

@ -0,0 +1,4 @@
#define __xstat __fxstat
#define _xstat _fxstat
#define stat fstat
#include "xstat.S"

View file

@ -0,0 +1,22 @@
/* Default control word for ix86 FPU.
Copyright (C) 1995 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. */
#include <fpu_control.h>
unsigned short ___fpu_control = _FPU_IEEE;

View file

@ -0,0 +1,84 @@
/* Initialization code run first thing by the ELF startup code.
For i386/Linux.
Copyright (C) 1995 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. */
#include <sysdep.h>
.text
/* Called from start.S. Not: there is no value in %ebx. */
ENTRY (__libc_init_first)
/* Make sure we are not using iBSC2 personality. */
movl $SYS_ify (personality), %eax
xorl %ebx, %ebx
int $0x80
#ifdef PIC
/* Set control work of FPU. */
call .L0
.L0: popl %ebx
addl $_GLOBAL_OFFSET_TABLE_+[.-.L0], %ebx
movzwl C_SYMBOL_NAME(___fpu_control@GOT)(%ebx), %eax
#else
movzwl ___fpu_control, %eax
#endif
pushl %eax
call JUMPTARGET(__setfpucw)
addl $4, %esp
/* That is all for now. */
ret
/* This is only a dummy function for the list below. */
.type _dummy_exit, @function
C_LABEL(_dummy_exit)
ret
.section .init,"ax",@progbits
movl 16(%ebp), %edx /* envp */
movl 12(%ebp), %ecx /* argv */
movl 8(%ebp), %eax /* argc */
pushl %edx
pushl %ecx
pushl %eax
call JUMPTARGET(__libc_init)
addl $12, %esp
/* Make sure __libc_subinit section is always present. */
.section __libc_subinit, "a", @progbits
.align 4
.type __elf_set___libc_subinit_element__dummy_exit__, @object
.size __elf_set___libc_subinit_element__dummy_exit__, 4
__elf_set___libc_subinit_element__dummy_exit__:
.long _dummy_exit
/* Make sure __libc_atexit section is always present. */
.section __libc_atexit, "a", @progbits
.align 4
.type __elf_set___libc_atexit_element__dummy_exit__, @object
.size __elf_set___libc_atexit_element__dummy_exit__, 4
__elf_set___libc_atexit_element__dummy_exit__:
.long _dummy_exit

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL__ (ipc, 5)
ret

View file

@ -0,0 +1,4 @@
#define __stat __lstat
#define stat lstat
#define __xstat __lxstat
#include "stat.S"

View file

@ -0,0 +1,4 @@
#define __xstat __lxstat
#define _xstat _lxstat
#define stat lstat
#include "xstat.S"

View file

@ -0,0 +1,39 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
/* In Linux the `mknod' call is actually done by a emulation of the
`xmknod' system call, which takes an additional first argument
giving a version number for the interface. This macro gives the
Linux version number that corresponds to the modern interface. */
#define _MKNOD_VER 1
ENTRY (__mknod)
movl 12(%esp), %edx
movl 8(%esp), %ecx
movl 4(%esp), %eax
pushl %edx
pushl %ecx
pushl %eax
pushl $_MKNOD_VER /* Push extra first arg to syscall. */
call JUMPTARGET(__xmknod)
addl $16, %esp /* Correct version parameter offset. */
ret
weak_alias (__mknod, mknod)

View file

@ -0,0 +1,45 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
.globl syscall_error
ENTRY (__mmap)
/* Save registers. */
movl %ebx, %edx
movl $SYS_ify(mmap), %eax /* System call number in %eax. */
lea 4(%esp), %ebx /* Address of args is 1st arg. */
/* Do the system call trap. */
int $0x80
/* Restore registers. */
movl %edx, %ebx
/* %eax is < 0 if there was an error. */
testl %eax, %eax
jl JUMPTARGET(syscall_error)
/* Successful; return the syscall's value. */
ret
weak_alias (__mmap, mmap)

View file

@ -0,0 +1,82 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
.data
.globl C_SYMBOL_NAME(__curbrk)
.text
.globl C_SYMBOL_NAME(syscall_error)
ENTRY (__sbrk)
movl %ebx, %edx
#ifdef PIC
/* Standard PIC nonsense to access `__curbrk' through the GOT. */
call .L0
.L0: popl %ecx
addl $_GLOBAL_OFFSET_TABLE_+[.-.L0], %ecx
movl C_SYMBOL_NAME(__curbrk@GOT)(%ecx), %ecx
movl (%ecx), %ebx
movl %ebx, %eax
testl %ebx, %ebx
jne .L1
/* We have to initialize `__curbrk' first. */
movl $SYS_ify(brk), %eax
int $0x80
movl %eax, (%ecx)
movl %eax, %ebx
.align 16, 0x90
.L1:
#else
movl C_SYMBOL_NAME(__curbrk), %ebx
movl %ebx, %eax
#endif
addl 4(%esp), %ebx
cmpl %ebx, %eax
je .L2
movl $SYS_ify(brk), %eax
int $0x80
cmpl %eax, %ebx
jne .L3
#ifdef PIC
xchgl %eax, (%ecx)
#else
xchgl %eax, C_SYMBOL_NAME(__curbrk)
#endif
.L2:
movl %edx, %ebx
ret
.align 16
.L3:
movl %edx, %ebx
jmp JUMPTARGET(syscall_error)
weak_alias (__sbrk, sbrk)

View file

@ -0,0 +1,43 @@
/* Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe.
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. */
#include <fpu_control.h>
void
__setfpucw (fpu_control)
unsigned short fpu_control;
{
volatile unsigned short cw;
/* If user supplied _fpu_control, use it ! */
if (!fpu_control)
{
/* use linux defaults */
fpu_control = _FPU_DEFAULT;
}
/* Get Control Word */
__asm__ volatile ("fnstcw %0" : "=m" (cw) : );
/* mask in */
cw &= _FPU_RESERVED;
cw = cw | (fpu_control & ~_FPU_RESERVED);
/* set cw */
__asm__ volatile ("fldcw %0" :: "m" (cw));
}

View file

@ -0,0 +1,66 @@
/* Signal number definitions. Linux version.
Copyright (C) 1995 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 SIGTRAP 5 /* Trace trap (POSIX). */
#define SIGABRT SIGIOT /* Abort (ANSI). */
#define SIGIOT 6 /* IOT trap (4.2 BSD). */
#define SIGBUS 7 /* BUS error (4.2 BSD). */
#define SIGFPE 8 /* Floating-point exception (ANSI). */
#define SIGKILL 9 /* Kill, unblockable (POSIX). */
#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */
#define SIGSEGV 11 /* Segmentation violation (ANSI). */
#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */
#define SIGPIPE 13 /* Broken pipe (POSIX). */
#define SIGALRM 14 /* Alarm clock (POSIX). */
#define SIGTERM 15 /* Termination (ANSI). */
#define SIGSTKFLT 16 /* ??? */
#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
#define SIGCHLD 17 /* Child status has changed (POSIX). */
#define SIGCONT 18 /* Continue (POSIX). */
#define SIGSTOP 19 /* Stop, unblockable (POSIX). */
#define SIGTSTP 20 /* Keyboard stop (POSIX). */
#define SIGTTIN 21 /* Background read from tty (POSIX). */
#define SIGTTOU 22 /* Background write to tty (POSIX). */
#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */
#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
#define SIGPOLL SIGIO /* Pollable event occured (System V). */
#define SIGIO 29 /* I/O now possible (4.2 BSD). */
#define SIGPWR 30 /* Power failure restart (System V). */
#define SIGUNUSED 31
#endif /* <signal.h> included. */
#define _NSIG 32 /* Biggest signal number + 1. */

View file

@ -19,6 +19,9 @@ Cambridge, MA 02139, USA. */
#include <sysdep.h>
#include <sys/socketcall.h>
#define P(a, b) P2(a, b)
#define P2(a, b) a##b
.globl syscall_error
/* The socket-oriented system calls are handled unusally in Linux.
@ -29,15 +32,16 @@ Cambridge, MA 02139, USA. */
The .S files for the other calls just #define socket and #include this. */
ENTRY (socket)
.globl P(__,socket)
ENTRY (P(__,socket))
/* Save registers. */
movl %ebx, %edx
movl $SYS_socketcall, %eax /* System call number in %eax. */
movl $SYS_ify(socketcall), %eax /* System call number in %eax. */
/* Use ## so `socket' is a separate token that might be #define'd. */
movl $SYS_##socket, %ebx /* Subcode is first arg to syscall. */
movl $P(SOCKOP_,socket), %ebx /* Subcode is first arg to syscall. */
lea 8(%esp), %ecx /* Address of args is 2nd arg. */
/* Do the system call trap. */
@ -52,3 +56,5 @@ ENTRY (socket)
/* Successful; return the syscall's value. */
ret
weak_alias (P(__,socket), socket)

View file

@ -0,0 +1,38 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
/* In Linux the `stat' call is actually done by emulating a `xstat' system
call, which takes an additional first argument giving a version number
for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
and `lxstat' emulations. This macro gives the Linux version number that
corresponds to the definition of `struct stat' in <statbuf.h>. */
#define _STAT_VER 1
ENTRY (__stat)
movl 8(%esp), %eax
movl 4(%esp), %ecx
pushl %eax
pushl %ecx
pushl $_STAT_VER /* Push extra first arg to syscall. */
call JUMPTARGET(__xstat)/* Jump to xstat implementation. */
addl $12, %esp
ret
weak_alias (__stat, stat)

View file

@ -18,12 +18,14 @@ Cambridge, MA 02139, USA. */
#include <sysdep.h>
ASM_GLOBAL_DIRECTIVE syscall_error
.globl syscall_error
ENTRY (syscall)
popl %ecx /* Pop return address into %ecx. */
popl %eax /* Pop syscall number into %eax. */
pushl %ecx /* Push back return address. */
DO_CALL (5) /* Frob the args and do the system call. */
movl (%esp), %ecx
pushl %ecx
testl %eax, %eax /* Check %eax for error. */
jl JUMPTARGET(syscall_error) /* Jump to error handler if negative. */
ret /* Return to caller. */

View file

@ -20,8 +20,21 @@ Cambridge, MA 02139, USA. */
The code for Linux is almost identical to the canonical Unix/i386
code, except that the error number in %eax is negated. */
.globl __syscall_error
__syscall_error:
negl %eax
#define __syscall_error __syscall_error_1
#include <sysdeps/unix/i386/sysdep.S>
/* Because the Linux version is in fact i386/ELF and the start.? file
for this system (sysdeps/i386/elf/start.S) is also used by The Hurd
and therefore this files must not contain the definition of the
`errno' variable (I don't know why, ask Roland), we have to define
it somewhere else.
...and this please is here. */
.data
.globl errno
errno:
.long 0

View file

@ -0,0 +1,135 @@
/* Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
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. */
/* In the Linux/ELF world, C symbols are asm symbols. */
#define NO_UNDERSCORES
/* There is some commonality. */
#include <sysdeps/unix/i386/sysdep.h>
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h
of the kernel. But these symbols do not follow the SYS_* syntax
so we have to redefine the `SYS_ify' macro here. */
#undef SYS_ify
#ifdef __STDC__
# define SYS_ify(syscall_name) __NR_##syscall_name
#else
# define SYS_ify(syscall_name) __NR_/**/syscall_name
#endif
#ifdef ASSEMBLER
/* Linux uses a negative return value to indicate syscall errors, unlike
most Unices, which use the condition codes' carry flag. */
#undef PSEUDO
#define PSEUDO(name, syscall_name, args) \
.text; \
.globl syscall_error; \
ENTRY (name) \
movl $SYS_ify (syscall_name), %eax; \
DO_CALL (args); \
testl %eax, %eax; \
jl JUMPTARGET (syscall_error)
/* We define our own ENTRY macro because the alignment should be 16 for ELF. */
#undef ENTRY
#define ENTRY(name) \
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME (name), @function) \
.align 16; \
C_LABEL (name)
/* Linux takes system call arguments in registers:
syscall number %eax call-clobbered
arg 1 %ebx call-saved
arg 2 %ecx call-clobbered
arg 3 %edx call-clobbered
arg 4 %esi call-saved
arg 5 %edi call-saved
The stack layout upon entering the function is:
20(%esp) Arg# 5
16(%esp) Arg# 4
12(%esp) Arg# 3
8(%esp) Arg# 2
4(%esp) Arg# 1
(%esp) Return address
(Of course a function with say 3 arguments does not have entries for
arguments 4 and 5.)
The following code tries hard to be optimal. A general assuption
(which is true accoriding to the data books I have) is that
2 * xchg is more expensive than pushl + movl + popl
Beside this a neat trick is used. The calling conventions for Linux
tell that among the registers used for parameters %ecx and %edx need
not be saved. Beside this we may clobber this registers even when
they are not used for parameter passing.
As a result one can see below that we save the content of the %ebx
register in the %edx register when we have less than 3 arguments
(2 * movl is less expensive than pushl + popl).
Second unlike for the other registers we don't save the content of
%ecx and %edx when we have than 1 and 2 registers resp. */
#undef DO_CALL
#define DO_CALL(args) \
DOARGS_##args \
int $0x80; \
UNDOARGS_##args
#define DOARGS_0 /* No arguments to frob. */
#define UNDOARGS_0 /* No arguments to unfrob. */
#define _DOARGS_0(n) /* No arguments to frob. */
#define _UNDOARGS_0 /* No arguments to unfrob. */
#define DOARGS_1 movl %ebx, %edx; movl 4(%esp), %ebx; DOARGS_0
#define UNDOARGS_1 UNDOARGS_0; movl %edx, %ebx
#define _DOARGS_1(n) pushl %ebx; movl n+4(%esp), %ebx; _DOARGS_0 (n)
#define _UNDOARGS_1 _UNDOARGS_0; popl %ebx
#define DOARGS_2 movl 8(%esp), %ecx; DOARGS_1
#define UNDOARGS_2 UNDOARGS_1
#define _DOARGS_2(n) movl n(%esp), %ecx; _DOARGS_1 (n-4)
#define _UNDOARGS_2 _UNDOARGS_1
#define DOARGS_3 _DOARGS_3 (12)
#define UNDOARGS_3 _UNDOARGS_3
#define _DOARGS_3(n) movl n(%esp), %edx; _DOARGS_2 (n-4)
#define _UNDOARGS_3 _UNDOARGS_2
#define DOARGS_4 _DOARGS_4 (16)
#define UNDOARGS_4 _UNDOARGS_4
#define _DOARGS_4(n) pushl %esi; movl n+4(%esp), %esi; _DOARGS_3 (n)
#define _UNDOARGS_4 _UNDOARGS_3; popl %esi
#define DOARGS_5 _DOARGS_5 (20)
#define UNDOARGS_5 _UNDOARGS_5
#define _DOARGS_5(n) pushl %edi; movl n+4(%esp), %edi; _DOARGS_4 (n)
#define _UNDOARGS_5 _UNDOARGS_4; popl %edi
#endif /* ASSEMBLER */

View file

@ -0,0 +1,49 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
#include <errnos.h>
.globl syscall_error
ENTRY (__xmknod)
popl %ecx /* Pop return address into %eax. */
popl %edx /* Pop version number into %edx. */
pushl %ecx /* Push back the return address. */
movl $SYS_ify(mknod), %eax
/* Load syscall number for prev_stat in %eax. */
cmpl $1, %edx /* Version 1 xstat call? */
je .L1 /* Yes, do syscall. */
movl $-EINVAL, %eax /* Load error code into %eax. */
jmp .L2
.L1: DO_CALL (3) /* Do the syscall. */
movl (%esp), %ecx
testl %eax, %eax /* Check for error. */
jl .L2
jmp *%ecx /* Return success. */
.L2: pushl %ecx
jmp JUMPTARGET(syscall_error)
/* Yes, then branch to error handling. */
/* For compatibility with Linux libc. */
weak_alias (__xmknod, _xmknod)

View file

@ -0,0 +1,51 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
#include <errnos.h>
#define SYS_expand(name) SYS_ify(name)
.globl syscall_error
ENTRY (__xstat)
popl %ecx /* Pop return address into %eax. */
popl %edx /* Pop version number into %edx. */
pushl %ecx /* Push back the return address. */
movl $SYS_expand(stat), %eax
/* Load syscall number for prev_stat in %eax. */
cmpl $1, %edx /* Version 1 xstat call? */
je .L1 /* Yes, do syscall. */
movl $-EINVAL, %eax /* Load error code into %eax. */
jmp .L2
.L1: DO_CALL (2) /* Do the syscall. */
movl (%esp), %ecx
testl %eax, %eax /* Check for error. */
jl .L2
jmp *%ecx /* Return success. */
.L2: pushl %ecx
jmp JUMPTARGET(syscall_error)
/* Yes, then branch to error handling. */
/* For compatibility with Linux libc. */
weak_alias (__xstat, _xstat)

View file

@ -0,0 +1,31 @@
/* Minimum guaranteed maximum values for system limits. Hurd version.
Copyright (C) 1993, 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. */
/* Linux has a fixed limit of supplementary groups allocated with a
process. This value is determined by the size of the `groups'
member of the `task_struct' structure in <linux/sched.h>. */
#define NGROUPS_MAX 32
/* Maximum size of file names. Not all file system types support
this size but it is only a maximum value. */
#define NAME_MAX 255

View file

@ -0,0 +1 @@
#include <sysdeps/stub/madvise.c>

View file

@ -0,0 +1,32 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/msg.h>
/* Allows to control internal state and destruction of message queue
objects. */
int
msgctl (msqid, cmd, buf)
int msqid;
int cmd;
struct msqid_ds *buf;
{
return __ipc (IPCOP_msgctl, msqid, cmd, 0, buf);
}

View file

@ -0,0 +1,32 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/msg.h>
#include <stdlib.h> /* for definition of NULL */
/* Return descriptor for message queue associated with KEY. The MSGFLG
parameter describes how to proceed with clashing of key values. */
int
msgget (key, msgflg)
key_t key;
int msgflg;
{
return __ipc (IPCOP_msgget, key, msgflg, 0, NULL);
}

View file

@ -0,0 +1,38 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/msg.h>
int
msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
int msqid;
void *msgp;
size_t msgsz;
long msgtyp;
int msgflg;
{
/* The problem here is that Linux' calling convention only allows up to
fives parameters to a system call. */
struct ipc_kludge tmp;
tmp.msgp = msgp;
tmp.msgtyp = msgtyp;
return __ipc (IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
}

View file

@ -0,0 +1,30 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/msg.h>
int
msgsnd (msqid, msgp, msgsz, msgflg)
int msqid;
void *msgp;
size_t msgsz;
int msgflg;
{
return __ipc (IPCOP_msgsnd, msqid, msgsz, msgflg, msgp);
}

View file

@ -0,0 +1,24 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL__ (pipe, 1)
ret
weak_alias (__pipe, pipe)

View file

@ -0,0 +1 @@
#include <sysdeps/stub/poll.c>

View file

@ -0,0 +1 @@
#include <sysdeps/posix/readv.c>

View file

@ -0,0 +1,2 @@
#define socket recv
#include <socket.S>

View file

@ -0,0 +1,2 @@
#define socket recvfrom
#include <socket.S>

View file

@ -0,0 +1,2 @@
#define socket recvmsg
#include <socket.S>

View file

@ -0,0 +1,33 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/sem.h>
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
int
semctl (semid, semnum, cmd, arg)
int semid;
int semnum;
int cmd;
union semun arg;
{
return __ipc (IPCOP_semctl, semid, semnum, cmd, &arg);
}

View file

@ -0,0 +1,33 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/sem.h>
#include <stdlib.h> /* for definition of NULL */
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
int
semget (key, nsems, semflg)
key_t key;
int nsems;
int semflg;
{
return __ipc (IPCOP_semget, key, nsems, semflg, NULL);
}

View file

@ -0,0 +1,31 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/sem.h>
/* Perform user-defined atomical operation of array of semaphores. */
int
semop (semid, sops, nsops)
int semid;
struct sembuf *sops;
unsigned int nsops;
{
return __ipc (IPCOP_semop, semid, (int) nsops, 0, sops);
}

View file

@ -0,0 +1,2 @@
#define socket send
#include <socket.S>

View file

@ -0,0 +1,2 @@
#define socket sendmsg
#include <socket.S>

View file

@ -0,0 +1,2 @@
#define socket sendto
#include <socket.S>

View file

@ -0,0 +1 @@
#include <sysdeps/unix/bsd/setegid.c>

View file

@ -0,0 +1,36 @@
/* Copyright (C) 1995 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. */
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
int
__seteuid (uid)
uid_t uid;
{
if (uid == (uid_t) ~0)
{
errno = EINVAL;
return -1;
}
return __setreuid (-1, uid);
}
weak_alias (__seteuid, seteuid)

View file

@ -0,0 +1,2 @@
#define SET_PROCEDURE 1
#include "gethostid.c"

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL (setpgid, 2)
ret

View file

@ -0,0 +1,25 @@
/* Copyright (C) 1995 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. */
#include <unistd.h>
int
setpgrp ()
{
return setpgid (0, 0);
}

View file

@ -0,0 +1,2 @@
#define socket setsockopt
#include <socket.S>

View file

@ -0,0 +1,24 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL__ (settimeofday, 2)
ret
weak_alias (__settimeofday, settimeofday)

View file

@ -0,0 +1,37 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/sem.h>
/* Attach the shared memory segment associated with SHMID to the data
segment of the calling process. SHMADDR and SHMFLG determine how
and where the segment is attached. */
char *
shmat (shmid, shmaddr, shmflg)
int shmid;
char *shmaddr;
int shmflg;
{
int retval;
unsigned long raddr;
retval = __ipc (IPCOP_shmat, shmid, shmflg, (int) &raddr, shmaddr);
return retval < 0 ? (char *) retval : (char *) raddr;
}

View file

@ -0,0 +1,31 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/shm.h>
/* Provide operations to control over shared memory segments. */
int
shmctl (shmid, cmd, buf)
int shmid;
int cmd;
struct shmid_ds *buf;
{
return __ipc (IPCOP_shmctl, shmid, cmd, 0, buf);
}

View file

@ -0,0 +1,30 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/shm.h>
/* Detach shared memory segment starting at address specified by SHMADDR
from the caller's data segment. */
int
shmdt (shmaddr)
char *shmaddr;
{
return __ipc (IPCOP_shmdt, 0, 0, 0, shmaddr);
}

View file

@ -0,0 +1,33 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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. */
#include <sys/shm.h>
#include <stdlib.h> /* for definition of NULL */
/* Return an identifier for an shared memory segment of at least size SIZE
which is associated with KEY. */
int
shmget (key, size, shmflg)
key_t key;
int size;
int shmflg;
{
return __ipc (IPCOP_shmget, key, size, shmflg, NULL);
}

View file

@ -0,0 +1,2 @@
#define socket shutdown
#include <socket.S>

View file

@ -0,0 +1,24 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL__ (sigaction, 3)
ret
weak_alias (__sigaction, sigaction)

View file

@ -0,0 +1,8 @@
#include <sysdeps/unix/sysv/signal.S>
/* Used in siginterrupt() */
.data
.globl _sigintr
_sigintr:
.long 0

View file

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/sco3.2.4/sigpending.S>

View file

@ -0,0 +1 @@
#include <sysdeps/generic/sigset.h>

View file

@ -0,0 +1,37 @@
/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version.
Copyright (C) 1995 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 _SOCKADDRCOM_H
#define _SOCKADDRCOM_H 1
/* This prevents including the file <linux/socket.h>. */
#define _LINUX_SOCKET_H
#define _LINUX_TYPES_H
/* This macro is used to declare the initial common members
of the data types used for socket addresses, `struct sockaddr',
`struct sockaddr_in', `struct sockaddr_un', etc. */
#define __SOCKADDR_COMMON(sa_prefix) \
unsigned short int sa_prefix##family
#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
#endif /* sockaddrcom.h */

View file

@ -0,0 +1,103 @@
/* `struct termios' speed frobnication functions. Linux version.
Copyright (C) 1991, 1992, 1993, 1995 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. */
#include <stddef.h>
#include <errno.h>
#include <termios.h>
static const speed_t speeds[] =
{
0,
50,
75,
110,
134,
150,
200,
300,
600,
1200,
1800,
2400,
4800,
9600,
19200,
38400,
38400, /* Mention this twice here is a trick. */
57600,
115200,
230400,
};
/* Return the output baud rate stored in *TERMIOS_P. */
speed_t
cfgetospeed (termios_p)
const struct termios *termios_p;
{
speed_t retval = termios_p->c_cflag & (CBAUD | CBAUDEX);
if (retval & CBAUDEX)
{
retval &= ~CBAUDEX;
retval |= CBAUD + 1;
}
return retval;
}
/* Return the input baud rate stored in *TERMIOS_P.
For Linux there is no difference between input and output speed. */
strong_alias (cfgetospeed, cfgetispeed);
/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
int
cfsetospeed (termios_p, speed)
struct termios *termios_p;
speed_t speed;
{
register unsigned int i;
if (termios_p == NULL)
{
errno = EINVAL;
return -1;
}
/* This allows either B1200 or 1200 to work. XXX
Do we really want to try to support this, given that
fetching the speed must return one or the other? */
for (i = 0; i < sizeof (speeds) / sizeof (speeds[0]); ++i)
if (i == speed || speeds[i] == speed)
{
termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
termios_p->c_cflag |= (i & CBAUD);
if (i & ~CBAUD)
termios_p->c_cflag |= CBAUDEX;
return 0;
}
errno = EINVAL;
return -1;
}
/* Set the input baud rate stored in *TERMIOS_P to SPEED.
For Linux there is no difference between input and output speed. */
strong_alias (cfsetospeed, cfsetispeed);

View file

@ -0,0 +1,72 @@
/* Copyright (C) 1992, 1995 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 _STATBUF_H
#define _STATBUF_H
struct stat
{
short int st_dev; /* Device. */
unsigned short __pad1;
unsigned long int st_ino; /* File serial number. */
unsigned short int st_mode; /* File mode. */
unsigned short int st_nlink; /* Link count. */
unsigned short int st_uid; /* User ID of the file's owner. */
unsigned short int st_gid; /* Group ID of the file's group.*/
unsigned short int st_rdev; /* Device number, if device. */
unsigned short int __pad2;
long int st_size; /* Size of file, in bytes. */
unsigned long int st_blksize; /* Optimal block size for I/O. */
#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */
unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */
long int st_atime; /* Time of last access. */
unsigned long int __unused1;
long int st_mtime; /* Time of last modification. */
unsigned long int __unused2;
long int st_ctime; /* Time of last status change. */
unsigned long int __unused3;
unsigned long int __unused4;
unsigned long int __unused5;
};
/* 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 */

View file

@ -0,0 +1,22 @@
/* Copyright (C) 1995 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. */
#include <sysdep.h>
SYSCALL (stty, 2)
ret

View file

@ -0,0 +1,84 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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 _SYS_IPC_BUF_H
#define _SYS_IPC_BUF_H
#include <features.h>
#include <sys/types.h>
/* Mode bits for `msgget', `semget', and `shmget'. */
#define IPC_CREAT 01000 /* create key if key does not exist */
#define IPC_EXCL 02000 /* fail if key exists */
#define IPC_NOWAIT 04000 /* return error on wait */
/* Control commands for `msgctl', `semctl', and `shmctl'. */
#define IPC_RMID 0 /* remove identifier */
#define IPC_SET 1 /* set `ipc_perm' options */
#define IPC_STAT 2 /* get `ipc_perm' options */
#define IPC_INFO 3 /* see ipcs */
__BEGIN_DECLS
/* Special key values. */
#define IPC_PRIVATE ((key_t) 0) /* private key */
/* Data structure used to pass permission information to IPC operations. */
struct ipc_perm
{
key_t __key; /* key */
__uid_t uid; /* owner's user ID */
__gid_t gid; /* owner's group ID */
__uid_t cuid; /* creator's user ID */
__gid_t cgid; /* creator's group ID */
__mode_t mode; /* read/write permission */
unsigned short int __seq; /* sequence number */
};
/* Kludge to work around Linux' restriction of only up to five
arguments to a system call. */
struct ipc_kludge
{
void *msgp;
long msgtyp;
};
/* The actual system call: all functions are multiplexed by this. */
extern int __ipc __P ((int __call, int __first, int __second, int __third,
void *__ptr));
/* The codes for the functions to use the multiplexer `__ipc'. */
#define IPCOP_semop 1
#define IPCOP_semget 2
#define IPCOP_semctl 3
#define IPCOP_msgsnd 11
#define IPCOP_msgrcv 12
#define IPCOP_msgget 13
#define IPCOP_msgctl 14
#define IPCOP_shmat 21
#define IPCOP_shmdt 22
#define IPCOP_shmget 23
#define IPCOP_shmctl 24
__END_DECLS
#endif /* sys/ipc_buf.h */

View file

@ -0,0 +1,112 @@
/* Definitions for BSD-style memory management. Linux version.
Copyright (C) 1994, 1995 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. */
/* These are the bits used by 4.4 BSD and its derivatives. On systems
(such as GNU) where these facilities are not system services but can be
emulated in the C library, these are the definitions we emulate. */
#ifndef _SYS_MMAN_H
#define _SYS_MMAN_H 1
#include <features.h>
#include <gnu/types.h>
#define __need_size_t
#include <stddef.h>
/* Protections are chosen from these bits, OR'd together. The
implementation does not necessarily support PROT_EXEC or PROT_WRITE
without PROT_READ. The only guarantees are that no writing will be
allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
#define PROT_NONE 0x00 /* No access. */
#define PROT_READ 0x01 /* Pages can be read. */
#define PROT_WRITE 0x02 /* Pages can be written. */
#define PROT_EXEC 0x04 /* Pages can be executed. */
/* Flags contain mapping type, sharing type and options. */
/* Mapping type (must choose one and only one of these). */
#define MAP_FILE 0x0000 /* Mapped from a file or device. */
#define MAP_ANON 0x0020 /* Allocated from anonymous virtual memory. */
#define MAP_TYPE 0x000f /* Mask for type field. */
/* Sharing types (must choose one and only one of these). */
#define MAP_COPY MAP_PRIVATE /* Virtual copy of region at mapping time. */
#define MAP_SHARED 0x0001 /* Share changes. */
#define MAP_PRIVATE 0x0002 /* Changes private; copy pages on write. */
/* Other flags. */
#define MAP_FIXED 0x0010 /* Map address must be exactly as requested. */
#define MAP_NOEXTEND 0x0000 /* For MAP_FILE, don't change file size.
Not available on Linux??? */
#define MAP_HASSEMPHORE 0x0000 /* Region may contain semaphores.
Not available on Linux??? */
#define MAP_INHERIT 0x0000 /* Region is retained after exec.
Not available on Linux??? */
/* Advice to `madvise'. */
#define MADV_NORMAL 0 /* No further special treatment. */
#define MADV_RANDOM 1 /* Expect random page references. */
#define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
#define MADV_WILLNEED 3 /* Will need these pages. */
#define MADV_DONTNEED 4 /* Don't need these pages. */
#include <sys/cdefs.h>
__BEGIN_DECLS
/* Map addresses starting near ADDR and extending for LEN bytes. from
OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
set in FLAGS, the mapping will be at ADDR exactly (which must be
page-aligned); otherwise the system chooses a convenient nearby address.
The return value is the actual mapping address chosen or (caddr_t) -1
for errors (in which case `errno' is set). A successful `mmap' call
deallocates any previous mapping for the affected region. */
__caddr_t __mmap __P ((__caddr_t __addr, size_t __len,
int __prot, int __flags, int __fd, __off_t __offset));
__caddr_t mmap __P ((__caddr_t __addr, size_t __len,
int __prot, int __flags, int __fd, __off_t __offset));
/* Deallocate any mapping for the region starting at ADDR and extending LEN
bytes. Returns 0 if successful, -1 for errors (and sets errno). */
int __munmap __P ((__caddr_t __addr, size_t __len));
int munmap __P ((__caddr_t __addr, size_t __len));
/* Change the memory protection of the region starting at ADDR and
extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
(and sets errno). */
int mprotect __P ((__caddr_t __addr, size_t __len, int __prot));
/* Synchronize the region starting at ADDR and extending LEN bytes with the
file it maps. Filesystem operations on a file being mapped are
unpredictable before this is done. */
int msync __P ((__caddr_t __addr, size_t __len));
/* Advise the system about particular usage patterns the program follows
for the region starting at ADDR and extending LEN bytes. */
int madvise __P ((__caddr_t __addr, size_t __len, int __advice));
__END_DECLS
#endif /* sys/mman.h */

View file

@ -0,0 +1,54 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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 _SYS_MSQ_BUF_H
#define _SYS_MSQ_BUF_H
#include <features.h>
#include <sys/types.h>
/* Define options for message queue functions. */
#define MSG_NOERROR 010000 /* no error if message is too big */
#define MSG_EXCEPT 020000 /* recv any msg except of specified type */
__BEGIN_DECLS
/* Structure of record for one message inside the kernel.
The type `struct __msg' is opaque. */
struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
struct msg *__msg_first; /* pointer to first message on queue */
struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
struct wait_queue *__wwait; /* ??? */
struct wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes;/* current number of bytes on queue */
unsigned short int msg_qnum; /* number of messages currently on queue */
unsigned short int msg_qbytes;/* max number of bytes allowed on queue */
__pid_t msg_lspid; /* pid of last msgsnd() */
__pid_t msg_lrpid; /* pid of last msgrcv() */
};
__END_DECLS
#endif /* sys/msq_buf.h */

View file

@ -0,0 +1,65 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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 _SYS_SEM_BUF_H
#define _SYS_SEM_BUF_H
#include <features.h>
#include <sys/types.h>
/* Flags for `semop'. */
#define SEM_UNDO 0x1000 /* undo the operation on exit */
/* Commands for `semctl'. */
#define GETPID 11 /* get sempid */
#define GETVAL 12 /* get semval */
#define GETALL 13 /* get all semval's */
#define GETNCNT 14 /* get semncnt */
#define GETZCNT 15 /* get semzcnt */
#define SETVAL 16 /* set semval */
#define SETALL 17 /* set all semval's */
__BEGIN_DECLS
/* Data structure describing a set of semaphores. */
struct semid_ds
{
struct ipc_perm sem_perm; /* operation permisson struct */
__time_t sem_otime; /* last semop() time */
__time_t sem_ctime; /* last time changed by semctl() */
struct sem *__sembase; /* ptr to first semaphore in array */
struct sem_queue *__sem_pending; /* pending operations */
struct sem_queue *__sem_pending_last; /* last pending operation */
struct sem_undo *__undo; /* ondo requests on this array */
unsigned short int sem_nsems; /* number of semaphores in set */
};
/* Union used for argument for `semctl'. */
union semun
{
int val; /* value for SETVAL */
struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
unsigned short int *array; /* array for GETALL & SETALL */
struct seminfo *__buf; /* buffer for IPC_INFO */
};
__END_DECLS
#endif /* sys/sem_buf.h */

View file

@ -0,0 +1,56 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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 _SYS_SHM_BUF_H
#define _SYS_SHM_BUF_H
#include <features.h>
#include <sys/types.h>
/* Flags for `shmat'. */
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
#define SHM_UNLOCK 12 /* unlock segment (root only) */
__BEGIN_DECLS
/* Data structure describing a set of semaphores. */
struct shmid_ds
{
struct ipc_perm sem_perm; /* operation permisson struct */
int shm_segsz; /* size of segment in bytes */
__time_t sem_atime; /* time of last shmat() */
__time_t sem_dtime; /* time of last shmdt() */
__time_t sem_ctime; /* time of last change by shmctl() */
__pid_t shm_cpid; /* pid of creator */
__pid_t shm_lpid; /* pid of last shmop */
unsigned short int shm_nattch; /* number of current attaches */
unsigned short int __shm_npages; /* size of segment (pages) */
unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *__attaches; /* descriptors for attaches */
};
__END_DECLS
#endif /* sys/shm_buf.h */

View file

@ -0,0 +1,46 @@
/* ID for functions called via socketcall system call.
Copyright (C) 1995 Free Software Foundation, Inc.
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 _SYS_SOCKETCALL_H
#define _SYS_SOCKETCALL_H
/* Define unique numbers for the operations permitted on socket. Linux
uses a single system call for all these functions. The relevant code
file is /usr/include/linux/net.h.
We cannot use a enum here because the values are used in assembler
code. */
#define SOCKOP_socket 1
#define SOCKOP_bind 2
#define SOCKOP_connect 3
#define SOCKOP_listen 4
#define SOCKOP_accept 5
#define SOCKOP_getsockname 6
#define SOCKOP_getpeername 7
#define SOCKOP_socketpair 8
#define SOCKOP_send 9
#define SOCKOP_recv 10
#define SOCKOP_sendto 11
#define SOCKOP_recvfrom 12
#define SOCKOP_shutdown 13
#define SOCKOP_setsockopt 14
#define SOCKOP_getsockopt 15
#define SOCKOP_sendmsg 16
#define SOCKOP_recvmsg 17
#endif

View file

@ -0,0 +1,30 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
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 _SYS_TIMEX_H
#define _SYS_TIMEX_H
#include <features.h>
#include <linux/timex.h>
__BEGIN_DECLS
extern int __adjtimex __P ((struct timex *__ntx));
__END_DECLS
#endif /* sys/timex.h */

View file

@ -0,0 +1,59 @@
/* Copyright (C) 1995 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 _SYSCALL_H
#define _SYSCALL_H
/* This file should list the numbers of the system the system knows.
But instead of duplicating this we use the information available
from the kernel sources. */
#include <asm/unistd.h>
/* Among the system calls defined there are
_dup2
_mkdir
_rmdir
_readlink
_symlink
_rename
_swapon
_access
_select
_getgroups
_setgroups
_getitimer
_setitimer
_setdomainname
_getrlimit
_setrlimit
_getrusage
_getpriority
_setpriority
_truncate
_ftruncate
_setpgid
_fchmod
_fchdir
_fchown
_setregid
_setreuid
_vhangup
(This is a hack for the autoconf mechanism. Don't change a single
character, esp white spaces, unless you know what you are doing!) */
#endif

View file

@ -0,0 +1 @@
#include <sysdeps/posix/sysconf.c>

View file

@ -0,0 +1,31 @@
/* Copyright (C) 1995 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. */
#include <termios.h>
#include <sys/ioctl.h>
/* Wait for pending output to be written on FD. */
int
__tcdrain (fd)
int fd;
{
/* With an argument of 1, TCSBRK for output to be drain. */
return __ioctl (fd, TCSBRK, 1);
}
weak_alias (__tcdrain, tcdrain)

View file

@ -0,0 +1 @@
#include <sysdeps/unix/bsd/sun/sunos4/tcflow.c>

View file

@ -0,0 +1 @@
#include <sysdeps/unix/bsd/sun/sunos4/tcflush.c>

View file

@ -0,0 +1,31 @@
/* Copyright (C) 1992, 1995 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. */
#include <termios.h>
#include <sys/ioctl.h>
/* Put the state of FD into *TERMIOS_P. */
int
__tcgetattr (fd, termios_p)
int fd;
struct termios *termios_p;
{
return __ioctl (fd, TCGETS, termios_p);
}
weak_alias (__tcgetattr, tcgetattr)

Some files were not shown because too many files have changed in this diff Show more