URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1534 to Rev 1535
- ↔ Reverse comparison
Rev 1534 → Rev 1535
/tags/release/linux/glibc/hacks.diff
0,0 → 1,557
diff -Nur glibc-2.3.1.old/elf/dynamic-link.h glibc-2.3.1/elf/dynamic-link.h |
--- glibc-2.3.1.old/elf/dynamic-link.h 2002-09-27 04:46:27.000000000 +0200 |
+++ glibc-2.3.1/elf/dynamic-link.h 2005-06-27 23:24:47.000000000 +0200 |
@@ -266,12 +266,7 @@ |
|
/* This can't just be an inline function because GCC is too dumb |
to inline functions containing inlines themselves. */ |
-# define ELF_DYNAMIC_RELOCATE(map, lazy, consider_profile) \ |
- do { \ |
- int edr_lazy = elf_machine_runtime_setup ((map), (lazy), \ |
- (consider_profile)); \ |
- ELF_DYNAMIC_DO_REL ((map), edr_lazy); \ |
- ELF_DYNAMIC_DO_RELA ((map), edr_lazy); \ |
- } while (0) |
+# define ELF_DYNAMIC_RELOCATE(map, lazy, consider_profile) 0 |
+/* FIXME */ |
|
#endif |
diff -Nur glibc-2.3.1.old/libio/iofflush.c glibc-2.3.1/libio/iofflush.c |
--- glibc-2.3.1.old/libio/iofflush.c 2002-02-25 06:21:51.000000000 +0100 |
+++ glibc-2.3.1/libio/iofflush.c 2005-06-23 17:56:40.000000000 +0200 |
@@ -53,5 +53,6 @@ |
|
#ifndef _IO_MTSAFE_IO |
weak_alias (_IO_fflush, fflush_unlocked) |
+libc_hidden_weak (fflush_unlocked) |
#endif |
#endif |
diff -Nur glibc-2.3.1.old/libio/iofwrite.c glibc-2.3.1/libio/iofwrite.c |
--- glibc-2.3.1.old/libio/iofwrite.c 2002-08-10 20:08:29.000000000 +0200 |
+++ glibc-2.3.1/libio/iofwrite.c 2005-06-23 17:56:41.000000000 +0200 |
@@ -58,5 +58,6 @@ |
libc_hidden_weak (fwrite) |
# ifndef _IO_MTSAFE_IO |
weak_alias (_IO_fwrite, fwrite_unlocked) |
+libc_hidden_weak (fwrite_unlocked) |
# endif |
#endif |
diff -Nur glibc-2.3.1.old/socket/sys/socket.h glibc-2.3.1/socket/sys/socket.h |
--- glibc-2.3.1.old/socket/sys/socket.h 2001-07-07 21:21:17.000000000 +0200 |
+++ glibc-2.3.1/socket/sys/socket.h 2005-07-04 00:13:42.000000000 +0200 |
@@ -62,7 +62,9 @@ |
uses with any of the listed types to be allowed without complaint. |
G++ 2.7 does not support transparent unions so there we want the |
old-style declaration, too. */ |
-#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU |
+#if 1 |
+/* FIXME: the new-style declarations conflict with our implementation of |
+ INLINE_SYSCALL */ |
# define __SOCKADDR_ARG struct sockaddr *__restrict |
# define __CONST_SOCKADDR_ARG __const struct sockaddr * |
#else |
diff -Nur glibc-2.3.1.old/stdio-common/sscanf.c glibc-2.3.1/stdio-common/sscanf.c |
--- glibc-2.3.1.old/stdio-common/sscanf.c 2002-08-10 20:09:08.000000000 +0200 |
+++ glibc-2.3.1/stdio-common/sscanf.c 2005-06-23 18:38:10.000000000 +0200 |
@@ -27,9 +27,7 @@ |
/* Read formatted input from S, according to the format string FORMAT. */ |
/* VARARGS2 */ |
int |
-sscanf (s, format) |
- const char *s; |
- const char *format; |
+sscanf (const char *s, const char *format, ...) |
{ |
va_list arg; |
int done; |
diff -Nur glibc-2.3.1.old/sysdeps/generic/check_fds.c glibc-2.3.1/sysdeps/generic/check_fds.c |
--- glibc-2.3.1.old/sysdeps/generic/check_fds.c 2002-04-14 20:27:21.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/generic/check_fds.c 2005-06-27 22:43:55.000000000 +0200 |
@@ -47,7 +47,8 @@ |
/* Something is wrong with this descriptor, it's probably not |
opened. Open /dev/null so that the SUID program we are |
about to start does not accidently use this descriptor. */ |
- int nullfd = __libc_open (_PATH_DEVNULL, mode); |
+ /* FIXME: what's the prob with __libc_open ?!? */ |
+ int nullfd = open (_PATH_DEVNULL, mode); |
/* We are very paranoid here. With all means we try to ensure |
that we are actually opening the /dev/null device and nothing |
else. |
diff -Nur glibc-2.3.1.old/sysdeps/generic/clone.c glibc-2.3.1/sysdeps/generic/clone.c |
--- glibc-2.3.1.old/sysdeps/generic/clone.c 1970-01-01 01:00:00.000000000 +0100 |
+++ glibc-2.3.1/sysdeps/generic/clone.c 2005-06-24 01:16:47.000000000 +0200 |
@@ -0,0 +1,32 @@ |
+/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. |
+ This file is part of the GNU C Library. |
+ |
+ The GNU C Library is free software; you can redistribute it and/or |
+ modify it under the terms of the GNU Lesser General Public |
+ License as published by the Free Software Foundation; either |
+ version 2.1 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 |
+ Lesser General Public License for more details. |
+ |
+ You should have received a copy of the GNU Lesser General Public |
+ License along with the GNU C Library; if not, write to the Free |
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
+ 02111-1307 USA. */ |
+ |
+#include <errno.h> |
+#include <unistd.h> |
+ |
+ |
+int |
+__clone () |
+{ |
+ __set_errno (ENOSYS); |
+ return -1; |
+} |
+stub_warning (clone) |
+ |
+weak_alias (__clone, clone) |
+#include <stub-tag.h> |
diff -Nur glibc-2.3.1.old/sysdeps/generic/dl-cache.c glibc-2.3.1/sysdeps/generic/dl-cache.c |
--- glibc-2.3.1.old/sysdeps/generic/dl-cache.c 2002-02-06 18:23:41.000000000 +0100 |
+++ glibc-2.3.1/sysdeps/generic/dl-cache.c 2005-06-27 23:17:12.000000000 +0200 |
@@ -208,7 +208,7 @@ |
unsigned long int *hwcap; |
uint64_t platform; |
#ifndef SHARED |
- weak_extern (_dl_hwcap); |
+/* FIXME */ |
#endif |
|
/* This is where the strings start. */ |
@@ -217,7 +217,7 @@ |
/* Now we can compute how large the string table is. */ |
cache_data_size = (const char *) cache + cachesize - cache_data; |
|
- hwcap = &GL(dl_hwcap); |
+ hwcap = NULL; /* FIXME */ |
platform = _dl_string_platform (GL(dl_platform)); |
if (platform != -1) |
platform = 1ULL << platform; |
diff -Nur glibc-2.3.1.old/sysdeps/generic/initfini.c glibc-2.3.1/sysdeps/generic/initfini.c |
--- glibc-2.3.1.old/sysdeps/generic/initfini.c 2001-09-25 03:13:41.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/generic/initfini.c 2005-06-26 04:07:08.000000000 +0200 |
@@ -65,11 +65,13 @@ |
static void |
call_gmon_start(void) |
{ |
+#ifdef PROF |
extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/ |
void (*gmon_start) (void) = __gmon_start__; |
|
if (gmon_start) |
gmon_start (); |
+#endif |
} |
|
SECTION (".init"); |
diff -Nur glibc-2.3.1.old/sysdeps/generic/libc-start.c glibc-2.3.1/sysdeps/generic/libc-start.c |
--- glibc-2.3.1.old/sysdeps/generic/libc-start.c 2002-09-15 20:53:15.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/generic/libc-start.c 2005-07-03 15:42:09.000000000 +0200 |
@@ -94,10 +95,12 @@ |
we need to setup errno. If there is no thread library and we |
handle TLS the function is defined in the libc to initialized the |
TLS handling. */ |
+#ifdef USE_TLS |
# if !(USE_TLS - 0) |
if (__pthread_initialize_minimal) |
# endif |
__pthread_initialize_minimal (); |
+#endif |
|
/* Some security at this point. Prevent starting a SUID binary where |
the standard file descriptors are not opened. We have to do this |
diff -Nur glibc-2.3.1.old/sysdeps/generic/mount.c glibc-2.3.1/sysdeps/generic/mount.c |
--- glibc-2.3.1.old/sysdeps/generic/mount.c 1970-01-01 01:00:00.000000000 +0100 |
+++ glibc-2.3.1/sysdeps/generic/mount.c 2005-06-25 16:17:13.000000000 +0200 |
@@ -0,0 +1,33 @@ |
+/* Copyright (C) 2005 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 Lesser General Public |
+ License as published by the Free Software Foundation; either |
+ version 2.1 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 |
+ Lesser General Public License for more details. |
+ |
+ You should have received a copy of the GNU Lesser General Public |
+ License along with the GNU C Library; if not, write to the Free |
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
+ 02111-1307 USA. */ |
+ |
+#include <errno.h> |
+#include <unistd.h> |
+ |
+int |
+__mount (const char *__special_file, const char *__dir, |
+ const char *__fstype, unsigned long int __rwflag, |
+ const void *__data) |
+{ |
+ __set_errno (ENOSYS); |
+ return -1; |
+} |
+weak_alias (__mount, mount); |
+ |
+stub_warning (mount) |
+#include <stub-tag.h> |
diff -Nur glibc-2.3.1.old/sysdeps/generic/swapon.c glibc-2.3.1/sysdeps/generic/swapon.c |
--- glibc-2.3.1.old/sysdeps/generic/swapon.c 2001-07-07 21:21:22.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/generic/swapon.c 2005-06-24 01:13:30.000000000 +0200 |
@@ -23,8 +23,7 @@ |
/* Make the block special device PATH available to the system for swapping. |
This call is restricted to the super-user. */ |
int |
-swapon (path) |
- const char *path; |
+swapon (const char *path, int flags) |
{ |
__set_errno (ENOSYS); |
return -1; |
diff -Nur glibc-2.3.1.old/sysdeps/generic/umount.c glibc-2.3.1/sysdeps/generic/umount.c |
--- glibc-2.3.1.old/sysdeps/generic/umount.c 1970-01-01 01:00:00.000000000 +0100 |
+++ glibc-2.3.1/sysdeps/generic/umount.c 2005-06-25 16:17:08.000000000 +0200 |
@@ -0,0 +1,31 @@ |
+/* Copyright (C) 2005 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 Lesser General Public |
+ License as published by the Free Software Foundation; either |
+ version 2.1 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 |
+ Lesser General Public License for more details. |
+ |
+ You should have received a copy of the GNU Lesser General Public |
+ License along with the GNU C Library; if not, write to the Free |
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
+ 02111-1307 USA. */ |
+ |
+#include <errno.h> |
+#include <unistd.h> |
+ |
+int |
+__umount (const char *name) |
+{ |
+ __set_errno (ENOSYS); |
+ return -1; |
+} |
+weak_alias (__umount, umount); |
+ |
+stub_warning (umount) |
+#include <stub-tag.h> |
diff -Nur glibc-2.3.1.old/sysdeps/generic/umount2.c glibc-2.3.1/sysdeps/generic/umount2.c |
--- glibc-2.3.1.old/sysdeps/generic/umount2.c 1970-01-01 01:00:00.000000000 +0100 |
+++ glibc-2.3.1/sysdeps/generic/umount2.c 2005-06-25 16:19:06.000000000 +0200 |
@@ -0,0 +1,31 @@ |
+/* Copyright (C) 2005 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 Lesser General Public |
+ License as published by the Free Software Foundation; either |
+ version 2.1 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 |
+ Lesser General Public License for more details. |
+ |
+ You should have received a copy of the GNU Lesser General Public |
+ License along with the GNU C Library; if not, write to the Free |
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
+ 02111-1307 USA. */ |
+ |
+#include <errno.h> |
+#include <unistd.h> |
+ |
+int |
+__umount2 (const char *name, int flags) |
+{ |
+ __set_errno (ENOSYS); |
+ return -1; |
+} |
+weak_alias (__umount2, umount2); |
+ |
+stub_warning (umount2) |
+#include <stub-tag.h> |
diff -Nur glibc-2.3.1.old/sysdeps/posix/open64.c glibc-2.3.1/sysdeps/posix/open64.c |
--- glibc-2.3.1.old/sysdeps/posix/open64.c 2002-08-02 23:46:59.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/posix/open64.c 2005-06-27 22:44:53.000000000 +0200 |
@@ -35,7 +35,8 @@ |
va_end (arg); |
} |
|
- return __libc_open (file, oflag | O_LARGEFILE, mode); |
+ /* FIXME: what's the prob with __libc_open ?!? */ |
+ return open (file, oflag | O_LARGEFILE, mode); |
} |
weak_alias (__libc_open64, BP_SYM (__open64)) |
libc_hidden_weak (BP_SYM (__open64)) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/fork.S glibc-2.3.1/sysdeps/unix/fork.S |
--- glibc-2.3.1.old/sysdeps/unix/fork.S 2002-08-26 23:16:13.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/fork.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,33 +0,0 @@ |
-/* Copyright (C) 1991,92,94,95,97,2002 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 Lesser General Public |
- License as published by the Free Software Foundation; either |
- version 2.1 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 |
- Lesser General Public License for more details. |
- |
- You should have received a copy of the GNU Lesser General Public |
- License along with the GNU C Library; if not, write to the Free |
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
- 02111-1307 USA. */ |
- |
-#include <sysdep.h> |
- |
-/* This code works for at least m68k. */ |
- |
-SYSCALL__ (fork, 0) |
- /* R1 is now 0 for the parent and 1 for the child. Decrement it to |
- make it -1 (all bits set) for the parent, and 0 (no bits set) |
- for the child. Then AND it with R0, so the parent gets |
- R0&-1==R0, and the child gets R0&0==0. */ |
- subl #1, r1 |
- andl r1, r0 |
- ret |
-PSEUDO_END (__fork) |
- |
-weak_alias (__fork, fork) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/getegid.S glibc-2.3.1/sysdeps/unix/getegid.S |
--- glibc-2.3.1.old/sysdeps/unix/getegid.S 2001-07-07 21:21:29.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/getegid.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,30 +0,0 @@ |
-/* Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. |
- This file is part of the GNU C Library. |
- |
- The GNU C Library is free software; you can redistribute it and/or |
- modify it under the terms of the GNU Lesser General Public |
- License as published by the Free Software Foundation; either |
- version 2.1 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 |
- Lesser General Public License for more details. |
- |
- You should have received a copy of the GNU Lesser General Public |
- License along with the GNU C Library; if not, write to the Free |
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
- 02111-1307 USA. */ |
- |
-#include <sysdep.h> |
- |
-#ifdef SYS_getegid |
-SYSCALL__ (getegid, 0) |
-#else |
-PSEUDO (__getegid, getgid, 0) |
- MOVE(r1, r0) |
-#endif |
- ret |
-PSEUDO_END(__getegid) |
- |
-weak_alias (__getegid, getegid) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/geteuid.S glibc-2.3.1/sysdeps/unix/geteuid.S |
--- glibc-2.3.1.old/sysdeps/unix/geteuid.S 2001-07-07 21:21:29.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/geteuid.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,30 +0,0 @@ |
-/* Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. |
- This file is part of the GNU C Library. |
- |
- The GNU C Library is free software; you can redistribute it and/or |
- modify it under the terms of the GNU Lesser General Public |
- License as published by the Free Software Foundation; either |
- version 2.1 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 |
- Lesser General Public License for more details. |
- |
- You should have received a copy of the GNU Lesser General Public |
- License along with the GNU C Library; if not, write to the Free |
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
- 02111-1307 USA. */ |
- |
-#include <sysdep.h> |
- |
-#ifdef SYS_geteuid |
-SYSCALL__ (geteuid, 0) |
-#else |
-PSEUDO (__geteuid, getuid, 0) |
- MOVE(r1, r0) |
-#endif |
- ret |
-PSEUDO_END(__geteuid) |
- |
-weak_alias (__geteuid, geteuid) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/getppid.S glibc-2.3.1/sysdeps/unix/getppid.S |
--- glibc-2.3.1.old/sysdeps/unix/getppid.S 2001-07-07 21:21:29.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/getppid.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,30 +0,0 @@ |
-/* Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. |
- This file is part of the GNU C Library. |
- |
- The GNU C Library is free software; you can redistribute it and/or |
- modify it under the terms of the GNU Lesser General Public |
- License as published by the Free Software Foundation; either |
- version 2.1 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 |
- Lesser General Public License for more details. |
- |
- You should have received a copy of the GNU Lesser General Public |
- License along with the GNU C Library; if not, write to the Free |
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
- 02111-1307 USA. */ |
- |
-#include <sysdep.h> |
- |
-#ifdef SYS_getppid |
-SYSCALL__ (getppid, 0) |
-#else |
-PSEUDO (__getppid, getpid, 0) |
- MOVE(r1, r0) |
-#endif |
- ret |
-PSEUDO_END(__getppid) |
- |
-weak_alias (__getppid, getppid) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/syscall.S glibc-2.3.1/sysdeps/unix/syscall.S |
--- glibc-2.3.1.old/sysdeps/unix/syscall.S 2001-07-07 21:21:29.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/syscall.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,30 +0,0 @@ |
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc. |
- This file is part of the GNU C Library. |
- |
- The GNU C Library is free software; you can redistribute it and/or |
- modify it under the terms of the GNU Lesser General Public |
- License as published by the Free Software Foundation; either |
- version 2.1 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 |
- Lesser General Public License for more details. |
- |
- You should have received a copy of the GNU Lesser General Public |
- License along with the GNU C Library; if not, write to the Free |
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
- 02111-1307 USA. */ |
- |
-#include <sysdep.h> |
- |
-#ifndef SYS_syscall |
-#define SYS_syscall 0 |
-#endif |
- |
-/* This works if the kernel does an "indirect system call" for system call 0, |
- taking the first argument word off the stack as the system call number. */ |
- |
-SYSCALL (syscall, 1) |
- ret |
-PSEUDO_END(syscall) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/sysv/linux/bits/errno.h glibc-2.3.1/sysdeps/unix/sysv/linux/bits/errno.h |
--- glibc-2.3.1.old/sysdeps/unix/sysv/linux/bits/errno.h 2002-08-29 01:39:22.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/sysv/linux/bits/errno.h 2005-06-23 18:15:12.000000000 +0200 |
@@ -40,6 +40,9 @@ |
# if !defined _LIBC || defined _LIBC_REENTRANT |
/* When using threads, errno is a per-thread value. */ |
# define errno (*__errno_location ()) |
+# else |
+# define errno errno |
+ extern int errno; |
# endif |
# endif /* !__ASSEMBLER__ */ |
#endif /* _ERRNO_H */ |
diff -Nur glibc-2.3.1.old/sysdeps/unix/sysv/linux/setegid.c glibc-2.3.1/sysdeps/unix/sysv/linux/setegid.c |
--- glibc-2.3.1.old/sysdeps/unix/sysv/linux/setegid.c 2002-08-13 16:29:42.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/sysv/linux/setegid.c 2005-07-03 23:32:24.000000000 +0200 |
@@ -20,10 +20,12 @@ |
#include <sys/syscall.h> |
#include <sys/types.h> |
#include <unistd.h> |
+#include <sysdep.h> |
|
#ifdef __NR_setresgid |
|
-extern int __setresgid (gid_t rgid, gid_t egid, gid_t sgid); |
+//extern int __setresgid (gid_t rgid, gid_t egid, gid_t sgid); |
+#define __setresgid(a,b,c) INLINE_SYSCALL(setresgid,3,a,b,c) |
|
int |
setegid (gid_t gid) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/sysv/linux/seteuid.c glibc-2.3.1/sysdeps/unix/sysv/linux/seteuid.c |
--- glibc-2.3.1.old/sysdeps/unix/sysv/linux/seteuid.c 2002-08-13 16:29:42.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/sysv/linux/seteuid.c 2005-06-27 23:29:21.000000000 +0200 |
@@ -20,12 +20,14 @@ |
#include <sys/syscall.h> |
#include <sys/types.h> |
#include <unistd.h> |
+#include <sysdep.h> |
|
#include "kernel-features.h" |
|
#if defined __NR_setresuid || __ASSUME_SETRESUID_SYSCALL > 0 |
|
-extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid); |
+// extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid); |
+#define __setresuid(a,b,c) INLINE_SYSCALL(setresuid,3,a,b,c) |
|
int |
seteuid (uid_t uid) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/sysv/linux/umount.S glibc-2.3.1/sysdeps/unix/sysv/linux/umount.S |
--- glibc-2.3.1.old/sysdeps/unix/sysv/linux/umount.S 1998-08-20 21:15:40.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/sysv/linux/umount.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,12 +0,0 @@ |
-/* This hack is necessary since the kernel people are making "strange" |
- changes. They simply rename old system calls. */ |
- |
-#include <sysdep.h> |
-#ifdef __NR_oldumount |
-PSEUDO (__umount, oldumount, 1) |
-#else |
-PSEUDO (__umount, umount, 1) |
-#endif |
- ret |
-PSEUDO_END(__umount) |
-weak_alias (__umount, umount) |
diff -Nur glibc-2.3.1.old/sysdeps/unix/sysv/linux/umount2.S glibc-2.3.1/sysdeps/unix/sysv/linux/umount2.S |
--- glibc-2.3.1.old/sysdeps/unix/sysv/linux/umount2.S 1998-08-20 21:15:49.000000000 +0200 |
+++ glibc-2.3.1/sysdeps/unix/sysv/linux/umount2.S 1970-01-01 01:00:00.000000000 +0100 |
@@ -1,13 +0,0 @@ |
-/* umount system call with two parameters. */ |
- |
-#include <sysdep.h> |
-#if defined __NR_oldumount || defined __NR_umount2 |
-#ifdef __NR_oldumount |
-PSEUDO (__umount2, umount, 2) |
-#else |
-PSEUDO (__umount2, umount2, 2) |
-#endif |
- ret |
-PSEUDO_END(__umount2) |
-weak_alias (__umount2, umount2) |
-#endif |
/tags/release/linux/glibc/detect-or32.diff
0,0 → 1,41
diff -Nur glibc-2.3.1.old/configure glibc-2.3.1/configure |
--- glibc-2.3.1.old/configure 2002-10-10 02:37:54.000000000 +0200 |
+++ glibc-2.3.1/configure 2005-07-03 23:01:26.000000000 +0200 |
@@ -1041,6 +1041,7 @@ |
m88k) base_machine=m88k machine=m88k/m88100 ;; |
mips64*) base_machine=mips64 machine=mips/mips64/$machine ;; |
mips*) base_machine=mips machine=mips/$machine ;; |
+or32) base_machine=openrisc machine=openrisc/or32 ;; |
powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; |
powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; |
s390) base_machine=s390 machine=s390/s390-32 ;; |
diff -Nur glibc-2.3.1.old/configure.in glibc-2.3.1/configure.in |
--- glibc-2.3.1.old/configure.in 2002-10-08 20:09:38.000000000 +0200 |
+++ glibc-2.3.1/configure.in 2005-07-03 23:01:39.000000000 +0200 |
@@ -320,6 +320,7 @@ |
m88k) base_machine=m88k machine=m88k/m88100 ;; |
mips64*) base_machine=mips64 machine=mips/mips64/$machine ;; |
mips*) base_machine=mips machine=mips/$machine ;; |
+or32) base_machine=openrisc machine=openrisc/or32 ;; |
powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;; |
powerpc64) base_machine=powerpc machine=powerpc/powerpc64 ;; |
s390) base_machine=s390 machine=s390/s390-32 ;; |
diff -Nur glibc-2.3.1.old/shlib-versions glibc-2.3.1/shlib-versions |
--- glibc-2.3.1.old/shlib-versions 2002-09-05 11:31:49.000000000 +0200 |
+++ glibc-2.3.1/shlib-versions 2005-06-25 17:05:04.000000000 +0200 |
@@ -25,6 +25,7 @@ |
cris-.*-linux.* DEFAULT GLIBC_2.2 |
x86_64-.*-linux.* DEFAULT GLIBC_2.2.5 |
powerpc64-.*-linux.* DEFAULT GLIBC_2.3 |
+or32-.*-linux.* DEFAULT GLIBC_2.3 |
.*-.*-gnu-gnu.* DEFAULT GLIBC_2.2.6 |
|
# Configuration Library=version Earliest symbol set (optional) |
@@ -73,6 +74,7 @@ |
powerpc64.*-.*-linux.* ld=ld64.so.1 GLIBC_2.3 |
cris-.*-linux.* ld=ld.so.1 GLIBC_2.2 |
x86_64-.*-linux.* ld=ld-linux-x86-64.so.2 GLIBC_2.2.5 |
+or32-.*-linux.* ld=ld.so.1 GLIBC_2.3 |
# We use the ELF ABI standard name for the default. |
.*-.*-.* ld=ld.so.1 |
|
/tags/release/linux/glibc/sysdeps/openrisc/bits/setjmp.h
0,0 → 1,54
/* Based on sysdeps/powerpc/bits/setjmp.h |
|
Copyright (C) 1997, 1998, 2000, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
/* Define the machine-dependent type `jmp_buf'. OpenRISC version. */ |
|
#ifndef _SETJMP_H |
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." |
#endif |
|
/* This file contains 32-bit assumptions */ |
#if __WORDSIZE == 64 |
#error |
#endif |
|
|
/* The previous bits/setjmp.h had __jmp_buf defined as a structure. |
We use an array of 'long int' instead, to make writing the |
assembler easier. Naturally, user code should not depend on |
either representation. */ |
|
#if defined __USE_MISC || defined _ASM |
# define JB_SR 0 /* To save flag */ |
# define JB_GPRS 1 /* Starting with GPR1, we don't save r0 - this is special register - allways zero */ |
# define JB_SP 1 /* GPR1 */ |
# define JB_LR 9 /* GPR9 */ |
# define JB_RV 11 /* GPR11 */ |
# define JB_SIZE (32*4) |
#endif |
|
#ifndef _ASM |
typedef long int __jmp_buf[32]; |
#endif |
|
/* Test if longjmp to JMPBUF would unwind the frame |
containing a local variable at ADDRESS. */ |
#define _JMPBUF_UNWINDS(jmpbuf, address) \ |
((void *) (address) < (void *) (jmpbuf)[JB_SP]) |
/tags/release/linux/glibc/sysdeps/openrisc/Implies
0,0 → 1,3
ieee754/flt-32 |
ieee754/dbl-64 |
# FIXME: do we have ldbl-96 ? and ldbl-128 ? |
/tags/release/linux/glibc/sysdeps/openrisc/or32/bits/endian.h
0,0 → 1,23
/* Copyright (C) 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#ifndef _ENDIAN_H |
# error "Never use <bits/endian.h> directly; include <endian.h> instead." |
#endif |
|
#define __BYTE_ORDER __BIG_ENDIAN |
/tags/release/linux/glibc/sysdeps/openrisc/or32/Implies
0,0 → 1,23
wordsize-32 |
/tags/release/linux/glibc/sysdeps/openrisc/or32/setjmp.S
0,0 → 1,66
/* setjmp for OR32. |
|
Copyright (C) 1995-1997, 1999-2001, 2005 Free Software Foundation, Inc. |
Contributed by ???? FIXME. |
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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#define _ASM |
#define _SETJMP_H |
#include <bits/setjmp.h> |
#include <bp-sym.h> |
|
ENTRY (BP_SYM (__sigsetjmp)) |
|
# l.mfspr r11,r0,SPR_SR |
# l.sw (JB_SR*4)(r3),r11 |
l.sw ((JB_GPRS+0)*4)(r3),r1 |
l.sw ((JB_GPRS+1)*4)(r3),r2 |
l.sw ((JB_GPRS+2)*4)(r3),r3 |
l.sw ((JB_GPRS+3)*4)(r3),r4 |
l.sw ((JB_GPRS+4)*4)(r3),r6 |
l.sw ((JB_GPRS+5)*4)(r3),r5 |
l.sw ((JB_GPRS+6)*4)(r3),r7 |
l.sw ((JB_GPRS+7)*4)(r3),r8 |
l.sw ((JB_GPRS+8)*4)(r3),r9 |
l.sw ((JB_GPRS+9)*4)(r3),r10 |
l.sw ((JB_GPRS+10)*4)(r3),r11 |
l.sw ((JB_GPRS+11)*4)(r3),r12 |
l.sw ((JB_GPRS+12)*4)(r3),r13 |
l.sw ((JB_GPRS+13)*4)(r3),r14 |
l.sw ((JB_GPRS+14)*4)(r3),r15 |
l.sw ((JB_GPRS+15)*4)(r3),r16 |
l.sw ((JB_GPRS+16)*4)(r3),r17 |
l.sw ((JB_GPRS+17)*4)(r3),r18 |
l.sw ((JB_GPRS+18)*4)(r3),r19 |
l.sw ((JB_GPRS+19)*4)(r3),r20 |
l.sw ((JB_GPRS+20)*4)(r3),r21 |
l.sw ((JB_GPRS+21)*4)(r3),r22 |
l.sw ((JB_GPRS+22)*4)(r3),r23 |
l.sw ((JB_GPRS+23)*4)(r3),r24 |
l.sw ((JB_GPRS+24)*4)(r3),r25 |
l.sw ((JB_GPRS+25)*4)(r3),r26 |
l.sw ((JB_GPRS+26)*4)(r3),r27 |
l.sw ((JB_GPRS+27)*4)(r3),r28 |
l.sw ((JB_GPRS+28)*4)(r3),r29 |
l.sw ((JB_GPRS+29)*4)(r3),r30 |
l.sw ((JB_GPRS+30)*4)(r3),r31 |
l.j JUMPTARGET (BP_SYM (__sigjmp_save)) |
l.nop |
|
END (BP_SYM (__sigsetjmp)) |
/tags/release/linux/glibc/sysdeps/openrisc/or32/__longjmp.S
0,0 → 1,63
/* longjmp for or32. |
Based on sysdeps/powerpc/powerpc32/__longjmp.S |
|
Copyright (C) 1995-1997, 1999-2001, 2005 Free Software Foundation, Inc. |
Contributed by ???? FIXME |
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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#define _ASM |
#define _SETJMP_H |
#include <bits/setjmp.h> |
#include <bp-sym.h> |
|
ENTRY (BP_SYM (__longjmp)) |
# l.lwz r11,(JB_SR*4)(r3) |
# l.mtspr r0,r11,SPR_SR |
l.lwz r1,((JB_GPRS+0)*4)(r3) |
l.lwz r2,((JB_GPRS+1)*4)(r3) |
l.lwz r5,((JB_GPRS+4)*4)(r3) |
l.lwz r6,((JB_GPRS+5)*4)(r3) |
l.lwz r7,((JB_GPRS+6)*4)(r3) |
l.lwz r8,((JB_GPRS+7)*4)(r3) |
l.lwz r9,((JB_GPRS+8)*4)(r3) |
l.lwz r10,((JB_GPRS+9)*4)(r3) |
l.lwz r12,((JB_GPRS+11)*4)(r3) |
l.lwz r13,((JB_GPRS+12)*4)(r3) |
l.lwz r14,((JB_GPRS+13)*4)(r3) |
l.lwz r15,((JB_GPRS+14)*4)(r3) |
l.lwz r16,((JB_GPRS+15)*4)(r3) |
l.lwz r17,((JB_GPRS+16)*4)(r3) |
l.lwz r18,((JB_GPRS+17)*4)(r3) |
l.lwz r19,((JB_GPRS+19)*4)(r3) |
l.lwz r20,((JB_GPRS+20)*4)(r3) |
l.lwz r21,((JB_GPRS+21)*4)(r3) |
l.lwz r22,((JB_GPRS+22)*4)(r3) |
l.lwz r23,((JB_GPRS+23)*4)(r3) |
l.lwz r24,((JB_GPRS+24)*4)(r3) |
l.lwz r25,((JB_GPRS+25)*4)(r3) |
l.lwz r26,((JB_GPRS+26)*4)(r3) |
l.lwz r27,((JB_GPRS+27)*4)(r3) |
l.lwz r28,((JB_GPRS+28)*4)(r3) |
l.lwz r29,((JB_GPRS+29)*4)(r3) |
l.lwz r30,((JB_GPRS+30)*4)(r3) |
l.lwz r31,((JB_GPRS+31)*4)(r3) |
l.jr r9 |
l.addi r11,r4,0 |
|
END (BP_SYM (__longjmp)) |
/tags/release/linux/glibc/sysdeps/openrisc/or32/elf/start.S
0,0 → 1,45
/* Startup code for programs linked with GNU libc. |
Copyright (C) 1998-2001, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include "bp-sym.h" |
|
/* These are the various addresses we require. */ |
.section ".rodata" |
.align 2 |
weak_extern(_init) |
weak_extern(_fini) |
L(start_addresses): |
.long JUMPTARGET(BP_SYM (main)) |
.long JUMPTARGET(_init) |
.long JUMPTARGET(_fini) |
ASM_SIZE_DIRECTIVE(L(start_addresses)) |
|
.section ".text" |
ENTRY(_start) |
l.addi r3,r1,0 |
l.j JUMPTARGET(BP_SYM (__libc_start_main)) |
l.nop |
END(_start) |
|
/* Define a symbol for the first piece of initialized data. */ |
.section ".data" |
.globl __data_start |
__data_start: |
weak_alias (__data_start, data_start) |
/tags/release/linux/glibc/sysdeps/openrisc/or32/dl-machine.h
0,0 → 1,209
/* Machine-dependent ELF dynamic relocation inline functions. OpenRISC version. |
Copyright (C) 1995-2002, 2005 Free Software Foundation, Inc. |
This file is part of the GNU C Library. |
|
Based on sysdeps/powerpc/powerpc32/dl-machine.h. |
|
The GNU C Library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
/* FIXME: severely fucked */ |
|
#ifndef dl_machine_h |
#define dl_machine_h |
|
#define ELF_MACHINE_NAME "or32" |
|
#include <assert.h> |
|
/* Return nonzero iff ELF header is compatible with the running host. */ |
static inline int |
elf_machine_matches_host (const Elf32_Ehdr *ehdr) |
{ |
return ehdr->e_machine == EM_OPENRISC; |
} |
|
|
/* Return the link-time address of _DYNAMIC, stored as |
the first value in the GOT. */ |
static inline Elf32_Addr |
elf_machine_dynamic (void) |
{ |
/* FIXME */ |
return NULL; |
} |
|
/* Return the run-time load address of the shared object. */ |
static inline Elf32_Addr |
elf_machine_load_address (void) |
{ |
/* FIXME */ |
return NULL; |
} |
|
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) /* nothing */ |
|
/* The PLT uses Elf32_Rela relocs. */ |
#define elf_machine_relplt elf_machine_rela |
|
/* This code is used in dl-runtime.c to call the `fixup' function |
and then redirect to the address it returns. It is called |
from code built in the PLT by elf_machine_runtime_setup. */ |
#define ELF_MACHINE_RUNTIME_TRAMPOLINE /* FIXME */ |
|
/* Mask identifying addresses reserved for the user program, |
where the dynamic linker should not map anything. */ |
#define ELF_MACHINE_USER_ADDRESS_MASK 0xf0000000UL |
|
/* The actual _start code is in dl-start.S. Use a really |
ugly bit of assembler to let dl-start.o see _dl_start. */ |
#define RTLD_START asm (".globl _dl_start"); |
|
/* FIXME */ |
#define ELF_PREFERRED_ADDRESS(loader, maplength, mapstartpref) 0 |
|
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so |
PLT entries should not be allowed to define the value. |
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one |
of the main executable's symbols, as for a COPY reloc. */ |
/* We never want to use a PLT entry as the destination of a |
reloc, when what is being relocated is a branch. This is |
partly for efficiency, but mostly so we avoid loops. */ |
#define elf_machine_type_class(type) \ |
((((type) == R_PPC_JMP_SLOT \ |
|| (type) == R_PPC_REL24 \ |
|| (type) == R_PPC_ADDR24) * ELF_RTYPE_CLASS_PLT) \ |
| (((type) == R_PPC_COPY) * ELF_RTYPE_CLASS_COPY)) |
|
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ |
#define ELF_MACHINE_JMP_SLOT R_PPC_JMP_SLOT |
|
/* The PowerPC never uses REL relocations. */ |
#define ELF_MACHINE_NO_REL 1 |
|
/* FIXME */ |
#define elf_machine_runtime_setup 0 |
|
static inline void |
elf_machine_lazy_rel (struct link_map *map, |
Elf32_Addr l_addr, const Elf32_Rela *reloc) |
{ |
/* elf_machine_runtime_setup handles this. */ |
} |
|
/* Change the PLT entry whose reloc is 'reloc' to call the actual routine. */ |
extern Elf32_Addr __elf_machine_fixup_plt (struct link_map *map, |
const Elf32_Rela *reloc, |
Elf32_Addr *reloc_addr, |
Elf32_Addr finaladdr); |
|
static inline Elf32_Addr |
elf_machine_fixup_plt (struct link_map *map, lookup_t t, |
const Elf32_Rela *reloc, |
Elf32_Addr *reloc_addr, Elf64_Addr finaladdr) |
{ |
return __elf_machine_fixup_plt (map, reloc, reloc_addr, finaladdr); |
} |
|
/* Return the final value of a plt relocation. */ |
static inline Elf32_Addr |
elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, |
Elf32_Addr value) |
{ |
return value + reloc->r_addend; |
} |
|
#endif /* dl_machine_h */ |
|
#ifdef RESOLVE |
|
/* FIXME */ |
|
/* Perform the relocation specified by RELOC and SYM (which is fully resolved). |
LOADADDR is the load address of the object; INFO is an array indexed |
by DT_* of the .dynamic section info. */ |
|
inline void |
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, |
const Elf32_Sym *sym, const struct r_found_version *version, |
Elf32_Addr *const reloc_addr) |
{ |
const Elf32_Sym *const refsym = sym; |
Elf32_Word finaladdr; |
const int rinfo = ELF32_R_TYPE (reloc->r_info); |
|
#ifndef RESOLVE_CONFLICT_FIND_MAP |
if (__builtin_expect (rinfo == R_PPC_NONE, 0)) |
return; |
|
/* The condition on the next two lines is a hack around a bug in Solaris |
tools on Sparc. It's not clear whether it should really be here at all, |
but if not the binutils need to be changed. */ |
if (rinfo == R_PPC_RELATIVE |
|| (sym->st_shndx != SHN_UNDEF |
&& ELF32_ST_BIND (sym->st_info) == STB_LOCAL)) |
{ |
/* Has already been relocated. */ |
Elf32_Word loadbase = map->l_addr; |
finaladdr = loadbase + reloc->r_addend; |
} |
else |
{ |
Elf32_Word loadbase |
= (Elf32_Word) (char *) (RESOLVE (&sym, version, |
ELF32_R_TYPE(reloc->r_info))); |
if (sym == NULL) |
{ |
/* Weak symbol that wasn't actually defined anywhere. */ |
assert (loadbase == 0); |
finaladdr = reloc->r_addend; |
} |
else |
finaladdr = (loadbase + (Elf32_Word) (char *) sym->st_value |
+ reloc->r_addend); |
} |
#else |
finaladdr = reloc->r_addend; |
if (rinfo == R_PPC_JMP_SLOT) |
RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr); |
#endif |
|
/* A small amount of code is duplicated here for speed. In libc, |
more than 90% of the relocs are R_PPC_RELATIVE; in the X11 shared |
libraries, 60% are R_PPC_RELATIVE, 24% are R_PPC_GLOB_DAT or |
R_PPC_ADDR32, and 16% are R_PPC_JMP_SLOT (which this routine |
wouldn't usually handle). As an bonus, doing this here allows |
the switch statement in __process_machine_rela to work. */ |
if (rinfo == R_PPC_RELATIVE |
|| rinfo == R_PPC_GLOB_DAT |
|| rinfo == R_PPC_ADDR32) |
{ |
*reloc_addr = finaladdr; |
} |
/* FIXME */ |
} |
|
static inline void |
elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, |
Elf32_Addr *const reloc_addr) |
{ |
*reloc_addr = l_addr + reloc->r_addend; |
} |
|
/* The SVR4 ABI specifies that the JMPREL relocs must be inside the |
DT_RELA table. */ |
#define ELF_MACHINE_PLTREL_OVERLAP 1 |
|
#endif /* RESOLVE */ |
/tags/release/linux/glibc/sysdeps/openrisc/or32/bsd-_setjmp.S
0,0 → 1,34
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. OR32 version. |
Based on sysdeps/powerpc/powerpc32/bsd-_setjmp.S. |
|
Copyright (C) 1994, 1997, 1999, 2000, 2005 Free Software Foundation, Inc. |
Contributed by ???? FIXME |
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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
/* This just does a tail-call to `__sigsetjmp (ARG, 0)'. |
We cannot do it in C because it must be a tail-call, so frame-unwinding |
in setjmp doesn't clobber the state restored by longjmp. */ |
|
#include <sysdep.h> |
#include <bp-sym.h> |
|
ENTRY (BP_SYM (_setjmp)) |
l.addi r4,r0,0 /* Set second argument to 0. */ |
l.j JUMPTARGET(BP_SYM (__sigsetjmp)) |
l.nop |
END (BP_SYM (_setjmp)) |
/tags/release/linux/glibc/sysdeps/openrisc/or32/bsd-setjmp.S
0,0 → 1,36
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. OR32 version. |
Based on PowerPC version and on uClibc. |
|
Copyright (C) 1994, 1997, 1999, 2000, 2005 Free Software Foundation, Inc. |
Contributed by ???? FIXME |
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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. |
We cannot do it in C because it must be a tail-call, so frame-unwinding |
in setjmp doesn't clobber the state restored by longjmp. */ |
|
#include <sysdep.h> |
#include <bp-sym.h> |
|
ENTRY (BP_SYM (__setjmp)) |
l.addi r4,r0,1 /* Set second argument to 1. */ |
l.j JUMPTARGET (BP_SYM (__sigsetjmp)) |
l.nop |
END (BP_SYM (__setjmp)) |
|
strong_alias (__setjmp, setjmp) |
/tags/release/linux/glibc/sysdeps/openrisc/sysdep.h
0,0 → 1,112
/* Assembly macros for 32-bit OpenRISC. |
Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc. |
This file is part of the GNU C Library. |
|
Based on sysdeps/powerpc/sysdep.h |
|
The GNU C Library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
/* FIXME: this file is severely fucked */ |
|
#ifdef __ASSEMBLER__ |
|
#ifdef __ELF__ |
|
#if 1 |
/* This seems to always be the case on PPC. (FIXME: maybe too on or32?) */ |
#define ALIGNARG(log2) log2 |
/* For ELF we need the `.type' directive to make shared libs work right. */ |
#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; |
#define ASM_SIZE_DIRECTIVE(name) .size name,.-name |
#endif |
|
/* FIXME: support PIC / PROF */ |
#define CALL_MCOUNT /* Do nothing. */ |
|
#define ENTRY(name) \ |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ |
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ |
.align ALIGNARG(2); \ |
C_LABEL(name) \ |
CALL_MCOUNT |
|
#define EALIGN_W_0 /* No words to insert. */ |
#define EALIGN_W_1 l.nop |
#define EALIGN_W_2 l.nop;l.nop |
#define EALIGN_W_3 l.nop;l.nop;l.nop |
#define EALIGN_W_4 EALIGN_W_3;l.nop |
#define EALIGN_W_5 EALIGN_W_4;l.nop |
#define EALIGN_W_6 EALIGN_W_5;l.nop |
#define EALIGN_W_7 EALIGN_W_6;l.nop |
|
/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes |
past a 2^align boundary. */ |
#ifdef PROF |
#define EALIGN(name, alignt, words) \ |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ |
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ |
.align ALIGNARG(2); \ |
C_LABEL(name) \ |
CALL_MCOUNT \ |
b 0f; \ |
.align ALIGNARG(alignt); \ |
EALIGN_W_##words; \ |
0: |
#else /* PROF */ |
#define EALIGN(name, alignt, words) \ |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ |
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ |
.align ALIGNARG(alignt); \ |
EALIGN_W_##words; \ |
C_LABEL(name) |
#endif |
|
#undef END |
#define END(name) \ |
ASM_SIZE_DIRECTIVE(name) |
|
/* FIXME */ |
#define DO_CALL |
|
#ifdef PIC |
#define JUMPTARGET(name) name##@plt |
#else |
#define JUMPTARGET(name) name |
#endif |
|
#define PSEUDO(name, syscall_name, args) \ |
.section ".text"; \ |
ENTRY (name) \ |
DO_CALL (SYS_ify (syscall_name)); |
|
#define PSEUDO_RET \ |
l.j JUMPTARGET(__syscall_error) |
#define ret PSEUDO_RET |
|
#undef PSEUDO_END |
#define PSEUDO_END(name) \ |
END (name) |
|
/* Local labels stripped out by the linker. */ |
#undef L |
#define L(x) .L##x |
|
/* Label in text section. */ |
#define C_TEXT(name) name |
|
#endif /* __ELF__ */ |
|
#endif /* __ASSEMBLER__ */ |
/tags/release/linux/glibc/sysdeps/unix/openrisc/sysdep.h
0,0 → 1,20
/* Copyright (C) 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdeps/unix/sysdep.h> |
#include <sysdeps/openrisc/sysdep.h> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/bits/mman.h
0,0 → 1,20
#include <sysdeps/unix/sysv/linux/powerpc/bits/mman.h> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/Implies
0,0 → 1,20
unix/sysv/linux/generic-socket |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/or32/bits/fcntl.h
0,0 → 1,179
/* O_*, F_*, FD_* bit values for Linux. |
Copyright (C) 1995-1998, 2000 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#ifndef _FCNTL_H |
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead." |
#endif |
|
|
#include <sys/types.h> |
|
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files |
located on an ext2 file system */ |
#define O_ACCMODE 0003 |
#define O_RDONLY 00 |
#define O_WRONLY 01 |
#define O_RDWR 02 |
#define O_CREAT 0100 /* not fcntl */ |
#define O_EXCL 0200 /* not fcntl */ |
#define O_NOCTTY 0400 /* not fcntl */ |
#define O_TRUNC 01000 /* not fcntl */ |
#define O_APPEND 02000 |
#define O_NONBLOCK 04000 |
#define O_NDELAY O_NONBLOCK |
#define O_SYNC 010000 |
#define O_FSYNC O_SYNC |
#define O_ASYNC 020000 |
|
#ifdef __USE_GNU |
# define O_DIRECTORY 040000 /* Must be a directory. */ |
# define O_NOFOLLOW 0100000 /* Do not follow links. */ |
#endif |
|
#ifdef __USE_LARGEFILE64 |
# define O_LARGEFILE 0200000 |
#endif |
|
/* For now Linux has synchronisity options for data and read operations. |
We define the symbols here but let them do the same as O_SYNC since |
this is a superset. */ |
#if defined __USE_POSIX199309 || defined __USE_UNIX98 |
# define O_DSYNC O_SYNC /* Synchronize data. */ |
# define O_RSYNC O_SYNC /* Synchronize read operations. */ |
#endif |
|
/* Values for the second argument to `fcntl'. */ |
#define F_DUPFD 0 /* Duplicate file descriptor. */ |
#define F_GETFD 1 /* Get file descriptor flags. */ |
#define F_SETFD 2 /* Set file descriptor flags. */ |
#define F_GETFL 3 /* Get file status flags. */ |
#define F_SETFL 4 /* Set file status flags. */ |
|
#ifndef __USE_FILE_OFFSET64 |
# define F_GETLK 5 /* Get record locking info. */ |
# define F_SETLK 6 /* Set record locking info (non-blocking). */ |
# define F_SETLKW 7 /* Set record locking info (blocking). */ |
#else |
# define F_GETLK F_GETLK64 /* Get record locking info. */ |
# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/ |
# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ |
#endif |
#define F_GETLK64 12 /* Get record locking info. */ |
#define F_SETLK64 13 /* Set record locking info (non-blocking). */ |
#define F_SETLKW64 14 /* Set record locking info (blocking). */ |
|
#if defined __USE_BSD || defined __USE_XOPEN2K |
# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */ |
# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */ |
#endif |
|
#ifdef __USE_GNU |
# define F_SETSIG 10 /* Set number of signal to be sent. */ |
# define F_GETSIG 11 /* Get number of signal to be sent. */ |
#endif |
|
#ifdef __USE_GNU |
# define F_SETLEASE 1024 /* Set a lease. */ |
# define F_GETLEASE 1025 /* Enquire what lease is active. */ |
# define F_NOTIFY 1026 /* Request notfications on a directory. */ |
#endif |
|
/* For F_[GET|SET]FL. */ |
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ |
|
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */ |
#define F_RDLCK 0 /* Read lock. */ |
#define F_WRLCK 1 /* Write lock. */ |
#define F_UNLCK 2 /* Remove lock. */ |
|
/* for old implementation of bsd flock () */ |
#define F_EXLCK 4 /* or 3 */ |
#define F_SHLCK 8 /* or 4 */ |
|
#ifdef __USE_BSD |
/* Operations for bsd flock(), also used by the kernel implementation */ |
# define LOCK_SH 1 /* shared lock */ |
# define LOCK_EX 2 /* exclusive lock */ |
# define LOCK_NB 4 /* or'd with one of the above to prevent |
blocking */ |
# define LOCK_UN 8 /* remove lock */ |
#endif |
|
#ifdef __USE_GNU |
# define LOCK_MAND 32 /* This is a mandatory flock: */ |
# define LOCK_READ 64 /* ... which allows concurrent read operations. */ |
# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */ |
# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */ |
#endif |
|
#ifdef __USE_GNU |
/* Types of directory notifications that may be requested with F_NOTIFY. */ |
# define DN_ACCESS 0x00000001 /* File accessed. */ |
# define DN_MODIFY 0x00000002 /* File modified. */ |
# define DN_CREATE 0x00000004 /* File created. */ |
# define DN_DELETE 0x00000008 /* File removed. */ |
# define DN_RENAME 0x00000010 /* File renamed. */ |
# define DN_ATTRIB 0x00000020 /* File changed attibutes. */ |
# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */ |
#endif |
|
struct flock |
{ |
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ |
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ |
#ifndef __USE_FILE_OFFSET64 |
__off_t l_start; /* Offset where the lock begins. */ |
__off_t l_len; /* Size of the locked area; zero means until EOF. */ |
#else |
__off64_t l_start; /* Offset where the lock begins. */ |
__off64_t l_len; /* Size of the locked area; zero means until EOF. */ |
#endif |
__pid_t l_pid; /* Process holding the lock. */ |
}; |
|
#ifdef __USE_LARGEFILE64 |
struct flock64 |
{ |
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ |
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ |
__off64_t l_start; /* Offset where the lock begins. */ |
__off64_t l_len; /* Size of the locked area; zero means until EOF. */ |
__pid_t l_pid; /* Process holding the lock. */ |
}; |
#endif |
|
/* Define some more compatibility macros to be backward compatible with |
BSD systems which did not managed to hide these kernel macros. */ |
#ifdef __USE_BSD |
# define FAPPEND O_APPEND |
# define FFSYNC O_FSYNC |
# define FASYNC O_ASYNC |
# define FNONBLOCK O_NONBLOCK |
# define FNDELAY O_NDELAY |
#endif /* Use BSD. */ |
|
/* Advise to `posix_fadvise'. */ |
#ifdef __USE_XOPEN2K |
# define POSIX_FADV_NORMAL 0 /* No further special treatment. */ |
# define POSIX_FADV_RANDOM 1 /* Expect random page references. */ |
# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ |
# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ |
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ |
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ |
#endif |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/or32/sigcontextinfo.h
0,0 → 1,29
/* Copyright (C) 1998-2001, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <signal.h> |
|
#define SIGCONTEXT struct sigcontext * |
#define SIGCONTEXT_EXTRA_ARGS |
#define GET_PC(ctx) ((void *)((ctx)->regs.pc)) |
/* FIXME: should this be 'sp'? */ |
#define GET_FRAME(ctx) (*(void **)((ctx)->regs.gprs[1])) |
/* FIXME: should this be 'sp'? */ |
#define GET_STACK(ctx) ((void *)((ctx)->regs.gprs[1])) |
#define CALL_SIGHANDLER(handler, signo, ctx) \ |
(handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx)) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/or32/sysdep.h
0,0 → 1,154
/* Based on sysdeps/unix/sysv/linux/sparc/sysdep.h. |
|
Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. |
This file is part of the GNU C Library. |
Contributed by ???? FIXME and Robert Millan <robertmh@gnu.org> |
|
The GNU C Library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#ifndef _LINUX_OR32_SYSDEP_H |
#define _LINUX_OR32_SYSDEP_H 1 |
|
#include <sysdeps/unix/openrisc/sysdep.h> |
|
#undef INLINE_SYSCALL |
#define INLINE_SYSCALL(name, nr, args...) inline_syscall##nr(name, args) |
|
/* FIXME: we can't use errno here untill we find a way to declare it |
(this header is included by assembly sources) */ |
#undef __SYSCALL_RETURN |
#if 0 |
#define __SYSCALL_RETURN \ |
(__sc_ret > (unsigned long)-4096 ? errno = -__sc_ret, __sc_ret = -1 : 0), \ |
__sc_ret |
#else |
/* FIXME: why can't we return __sc_ret ?? */ |
#define __SYSCALL_RETURN 0 |
#endif |
|
#undef __SYSCALL_CLOBBERS |
#define __SYSCALL_CLOBBERS |
|
#define inline_syscall0(name,dummy...) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
|
#define inline_syscall1(name,arg1) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#define inline_syscall2(name,arg1,arg2) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
register long __b __asm__ ("r4") = (long)(arg2); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a), "r" (__b)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#define inline_syscall3(name,arg1,arg2,arg3) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
register long __b __asm__ ("r4") = (long)(arg2); \ |
register long __c __asm__ ("r5") = (long)(arg3); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a), "r" (__b), "r" (__c)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#define inline_syscall4(name,arg1,arg2,arg3,arg4) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
register long __b __asm__ ("r4") = (long)(arg2); \ |
register long __c __asm__ ("r5") = (long)(arg3); \ |
register long __d __asm__ ("r6") = (long)(arg4); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a), "r" (__b), "r" (__c), "r" (__d)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
register long __b __asm__ ("r4") = (long)(arg2); \ |
register long __c __asm__ ("r5") = (long)(arg3); \ |
register long __d __asm__ ("r6") = (long)(arg4); \ |
register long __e __asm__ ("r7") = (long)(arg5); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a), "r" (__b), "r" (__c), "r" (__d), "r" (__e)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
register long __b __asm__ ("r4") = (long)(arg2); \ |
register long __c __asm__ ("r5") = (long)(arg3); \ |
register long __d __asm__ ("r6") = (long)(arg4); \ |
register long __e __asm__ ("r7") = (long)(arg5); \ |
register long __f __asm__ ("r8") = (long)(arg6); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a), "r" (__b), "r" (__c), "r" (__d), "r" (__e), "r" (__f)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#define inline_syscall7(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7) \ |
({ \ |
register long __sc_ret __asm__ ("r11") = __NR_##name; \ |
register long __a __asm__ ("r3") = (long)(arg1); \ |
register long __b __asm__ ("r4") = (long)(arg2); \ |
register long __c __asm__ ("r5") = (long)(arg3); \ |
register long __d __asm__ ("r6") = (long)(arg4); \ |
register long __e __asm__ ("r7") = (long)(arg5); \ |
register long __f __asm__ ("r8") = (long)(arg6); \ |
register long __g __asm__ ("r9") = (long)(arg7); \ |
__asm__ __volatile__ ("l.sys 1" \ |
: "=r" (__sc_ret) \ |
: "r" (__sc_ret), "r" (__a), "r" (__b), "r" (__c), "r" (__d), "r" (__e), "r" (__f), "r" (__g)); \ |
__asm__ __volatile__ ("l.nop"); \ |
__SYSCALL_RETURN; \ |
}) |
|
#endif /* _LINUX_OR32_SYSDEP_H */ |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/uname.c
0,0 → 1,38
/* Copyright (C) 2005 Free Software Foundation, Inc. |
Contributed by Robert Millan <robertmh@gnu.org> |
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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <string.h> |
#include <sys/utsname.h> |
#include <sysdep.h> |
|
/* Hack up sysname to keep config.guess happy. */ |
int |
__uname (name) |
struct utsname *name; |
{ |
if (INLINE_SYSCALL (uname, 1, name) == -1) |
return -1; |
|
strncpy (name->sysname, "GNU/Linux", sizeof (name->sysname)); |
|
return 0; |
} |
weak_alias (__uname, uname) |
libc_hidden_def (__uname) |
libc_hidden_def (uname) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/fcntl.c
0,0 → 1,38
#include <sysdeps/unix/sysv/linux/i386/fcntl.c> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/sysdep.c
0,0 → 1,38
#include <sysdeps/unix/sysv/linux/powerpc/sysdep.c> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/profil-counter.h
0,0 → 1,2
/* We can use the ix86 version. */ |
#include <sysdeps/unix/sysv/linux/i386/profil-counter.h> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/sys/procfs.h
0,0 → 1,2
#include <sysdeps/unix/sysv/linux/powerpc/sys/procfs.h> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/openrisc/sys/user.h
0,0 → 1,2
#include <sysdeps/unix/sysv/linux/powerpc/sys/user.h> |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/setsockopt.c
0,0 → 1,37
/* Copyright (C) 1991, 1995-1998, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Set socket FD's option OPTNAME at protocol level LEVEL |
to *OPTVAL (which is OPTLEN bytes long). |
Returns 0 on success, -1 for errors. */ |
int |
__setsockopt (fd, level, optname, optval, optlen) |
int fd; |
int level; |
int optname; |
const __ptr_t optval; |
socklen_t optlen; |
{ |
return INLINE_SYSCALL(socketcall, 6, SOCKOP_setsockopt, fd, level, optname, optval, optlen); |
} |
|
weak_alias (__setsockopt, setsockopt) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/listen.c
0,0 → 1,33
/* Copyright (C) 1991, 1995-1997, 2001, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Prepare to accept connections on socket FD. |
N connection requests will be queued before further requests are refused. |
Returns 0 on success, -1 for errors. */ |
int |
__listen (fd, n) |
int fd; |
int n; |
{ |
return INLINE_SYSCALL(socketcall, 3, SOCKOP_listen, fd, n); |
} |
weak_alias (__listen, listen) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/recv.c
0,0 → 1,33
/* Copyright (C) 1991, 1995-1997, 2001, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Read N bytes into BUF from socket FD. |
Returns the number read or -1 for errors. */ |
ssize_t |
recv (fd, buf, n, flags) |
int fd; |
void *buf; |
size_t n; |
int flags; |
{ |
return INLINE_SYSCALL(socketcall, 5, SOCKOP_recv, fd, buf, n, flags); |
} |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/accept.c
0,0 → 1,35
/* Copyright (C) 1991, 1995-1997, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Await a connection on socket FD. |
When a connection arrives, open a new socket to communicate with it, |
set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting |
peer and *ADDR_LEN to the address's actual length, and return the |
new socket's descriptor, or -1 for errors. */ |
int |
accept (fd, addr, addr_len) |
int fd; |
__SOCKADDR_ARG addr; |
socklen_t *addr_len; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_accept, fd, addr, addr_len); |
} |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/sendmsg.c
0,0 → 1,34
/* Copyright (C) 1991, 1995-1997, 2001, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Send a message described MESSAGE on socket FD. |
Returns the number of bytes sent, or -1 for errors. */ |
ssize_t |
__sendmsg (fd, message, flags) |
int fd; |
const struct msghdr *message; |
int flags; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_sendmsg, fd, message, flags); |
} |
|
weak_alias (__sendmsg, sendmsg) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/getsockname.c
0,0 → 1,33
/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Put the local address of FD into *ADDR and its length in *LEN. */ |
int |
__getsockname (fd, addr, len) |
int fd; |
__SOCKADDR_ARG addr; |
socklen_t *len; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_getsockname, fd, addr, len); |
} |
|
weak_alias (__getsockname, getsockname) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/socketpair.c
0,0 → 1,35
/* Copyright (C) 1991, 1995-1997, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Create two new sockets, of type TYPE in domain DOMAIN and using |
protocol PROTOCOL, which are connected to each other, and put file |
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero, |
one will be chosen automatically. Returns 0 on success, -1 for errors. */ |
int |
socketpair (domain, type, protocol, fds) |
int domain; |
int type; |
int protocol; |
int fds[2]; |
{ |
return INLINE_SYSCALL(socketcall, 5, SOCKOP_socketpair, domain, type, protocol, fds); |
} |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/recvmsg.c
0,0 → 1,34
/* Copyright (C) 1991, 1995-1997, 2001, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Receive a message as described by MESSAGE from socket FD. |
Returns the number of bytes read or -1 for errors. */ |
ssize_t |
__recvmsg (fd, message, flags) |
int fd; |
struct msghdr *message; |
int flags; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_recvmsg, fd, message, flags); |
} |
|
weak_alias (__recvmsg, recvmsg) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/shutdown.c
0,0 → 1,35
/* Copyright (C) 1991, 1995-1997, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Shut down all or part of the connection open on socket FD. |
HOW determines what to shut down: |
0 = No more receptions; |
1 = No more transmissions; |
2 = No more receptions or transmissions. |
Returns 0 on success, -1 for errors. */ |
int |
shutdown (fd, how) |
int fd; |
int how; |
{ |
return INLINE_SYSCALL(socketcall, 3, SOCKOP_shutdown, fd, how); |
} |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/bind.c
0,0 → 1,33
/* Copyright (C) 1991, 1995-1997, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Give the socket FD the local address ADDR (which is LEN bytes long). */ |
int |
__bind (fd, addr, len) |
int fd; |
__CONST_SOCKADDR_ARG addr; |
socklen_t len; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_bind, fd, addr, len); |
} |
|
weak_alias (__bind, bind) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/getsockopt.c
0,0 → 1,35
/* Copyright (C) 1991, 1995-1997, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL |
into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's |
actual length. Returns 0 on success, -1 for errors. */ |
int |
getsockopt (fd, level, optname, optval, optlen) |
int fd; |
int level; |
int optname; |
void *optval; |
socklen_t *optlen; |
{ |
return INLINE_SYSCALL(socketcall, 6, SOCKOP_getsockopt, fd, level, optname, optval, optlen); |
} |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/recvfrom.c
0,0 → 1,38
/* Copyright (C) 1991, 1995-1997, 2001, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Read N bytes into BUF through socket FD from peer |
at address ADDR (which is ADDR_LEN bytes long). |
Returns the number read or -1 for errors. */ |
ssize_t |
__recvfrom (fd, buf, n, flags, addr, addr_len) |
int fd; |
void *buf; |
size_t n; |
int flags; |
__SOCKADDR_ARG addr; |
socklen_t *addr_len; |
{ |
return INLINE_SYSCALL(socketcall, 7, SOCKOP_recvfrom, fd, buf, n, flags, addr, addr_len); |
} |
|
weak_alias (__recvfrom, recvfrom) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/socket.c
0,0 → 1,34
/* Copyright (C) 1991, 1995-1998, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Create a new socket of type TYPE in domain DOMAIN, using |
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically. |
Returns a file descriptor for the new socket, or -1 for errors. */ |
int |
__socket (domain, type, protocol) |
int domain; |
int type; |
int protocol; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_socket, domain, type, protocol); |
} |
weak_alias (__socket, socket) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/send.c
0,0 → 1,34
/* Copyright (C) 1991, 1995-1997, 2001, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */ |
ssize_t |
__send (fd, buf, n, flags) |
int fd; |
__const __ptr_t buf; |
size_t n; |
int flags; |
{ |
return INLINE_SYSCALL(socketcall, 5, SOCKOP_send, fd, buf, n, flags); |
} |
libc_hidden_def (__send) |
weak_alias (__send, send) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/connect.c
0,0 → 1,35
/* Copyright (C) 1991, 1995-1997, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long). |
For connectionless socket types, just set the default address to send to |
and the only address from which to accept transmissions. |
Return 0 on success, -1 for errors. */ |
int |
__connect (fd, addr, len) |
int fd; |
__CONST_SOCKADDR_ARG addr; |
socklen_t len; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_connect, fd, addr, len); |
} |
weak_alias (__connect, connect) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/sendto.c
0,0 → 1,36
/* Copyright (C) 1991, 1995-1997, 2001, 2002, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is |
ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */ |
ssize_t |
__sendto (fd, buf, n, flags, addr, addr_len) |
int fd; |
__const __ptr_t buf; |
size_t n; |
int flags; |
__CONST_SOCKADDR_ARG addr; |
socklen_t addr_len; |
{ |
return INLINE_SYSCALL(socketcall, 7, SOCKOP_sendto, fd, buf, n, flags, addr, addr_len); |
} |
weak_alias (__sendto, sendto) |
/tags/release/linux/glibc/sysdeps/unix/sysv/linux/generic-socket/getpeername.c
0,0 → 1,33
/* Copyright (C) 1991, 1995-1997, 2005 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 Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 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 |
Lesser General Public License for more details. |
|
You should have received a copy of the GNU Lesser General Public |
License along with the GNU C Library; if not, write to the Free |
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
02111-1307 USA. */ |
|
#include <sysdep.h> |
#include <socketcall.h> |
#include <sys/socket.h> |
|
/* Put the address of the peer connected to socket FD into *ADDR |
(which is *LEN bytes long), and its actual length into *LEN. */ |
int |
__getpeername (fd, addr, len) |
int fd; |
__SOCKADDR_ARG addr; |
socklen_t *len; |
{ |
return INLINE_SYSCALL(socketcall, 4, SOCKOP_getpeername, fd, addr, len); |
} |
weak_alias (__getpeername, getpeername) |