aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/shm_open.c
AgeCommit message (Collapse)AuthorFilesLines
2014-12-11Refactor shm_{open,unlink} code to separate Linux-specific directory choice ↵Roland McGrath1-226/+0
from POSIX-generic code.
2014-06-25Remove __ASSUME_O_CLOEXEC / O_CLOEXEC conditionals in sysdeps/unix/sysv/linux/.Joseph Myers1-47/+2
This patch removes conditionals on __ASSUME_O_CLOEXEC, and on O_CLOEXEC being defined, in sysdeps/unix/sysv/linux/, now that O_CLOEXEC support can be unconditionally assumed. The patch is conservative in what it changes and further followup cleanups may be possible. It may be possible to remove dl-opendir.c, but the patch does not do so, just removing a redundant undefine and redefine of __ASSUME_O_CLOEXEC. Also, __ASSUME_O_CLOEXEC is defined unconditionally for Hurd as well as Linux. Thus, if we decide that O_CLOEXEC support is a required feature of any glibc port, we could remove __ASSUME_O_CLOEXEC and all conditionals on it throughout glibc, rather than just cleaning up sysdeps/unix/sysv/linux/. Tested x86_64 that the disassembly of installed shared libraries is unchanged by this patch. * sysdeps/unix/sysv/linux/dl-opendir.c (__ASSUME_O_CLOEXEC): Do not undefine and redefine. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs) [O_CLOEXEC]: Make code unconditional. (__get_nprocs) [!O_CLOEXEC]: Remove conditional code. * sysdeps/unix/sysv/linux/shm_open.c: Do not include <kernel-features.h>. [O_CLOEXEC && !__ASSUME_O_CLOEXEC] (have_o_cloexec): Remove conditional variable definition. (shm_open) [O_CLOEXEC]: Make code unconditional. (shm_open) [!O_CLOEXEC || !__ASSUME_O_CLOEXEC]: Remove conditional code.
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka1-3/+3
2014-02-08shm_open: sync with logic in sem_openMike Frysinger1-3/+6
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae1-1/+1
2013-12-03Properly handle shm_open validation. Fixes bug 16274.Ondřej Bílka1-2/+2
2013-10-31Restrict shm_open and shm_unlink to SHMDIR. Fixes bugs 14752 and 15763.Ondřej Bílka1-6/+8
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers1-1/+1
2012-08-03Remove some pre-2.6.0 Linux kernel conditionals.Joseph Myers1-6/+2
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert1-3/+2
2007-08-10(shm_open): Fix typo in last change.Ulrich Drepper1-1/+1
2007-08-10(shm_open): Use O_CLOEXEC is available.Ulrich Drepper1-16/+39
2006-01-16* sysdeps/unix/sysv/linux/kernel-features.h: DefineUlrich Drepper1-2/+7
__ASSUME_TMPFS_NAME. * sysdeps/unix/sysv/linux/shm_open.c [!__ASSUME_TMPFS_NAME] (where_is_shmfs): Don't test for obsolete shm filesystem name. * sysdeps/unix/sysv/linux/getsysstats.c: Don't search for proc mount point. We assume procfs is mounted at /proc in many other places already.
2004-12-22(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper1-7/+2
2007-07-122.5-18.1Jakub Jelinek1-2/+7
2004-04-20Update.Ulrich Drepper1-2/+5
2004-04-20 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/shm_open.c (shm_unlink): Change EPERM into EACCES. 2004-04-20 Jakub Jelinek <jakub@redhat.com> * stdio-common/vfscanf.c (_IO_vfscanf): Revert last %% whitespace handling change. * stdio-common/tst-sscanf.c (int_tests): Adjust. * nis/nss-nis.c: Include stdlib.h. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Shut up a warning. * sysdeps/sparc/sparc64/memcmp.S (memcmp): Remove BP_SYM () from libc_hidden_builtin_def. 2004-04-20 Jim Meyering <jim@meyering.net> * misc/error.c (error_tail): Don't leak upon realloc failure. 2004-04-20 Martin Schwidefsky <schwidefsky@de.ibm.com> * sysdeps/unix/sysv/linux/dl-execstack.c (_dl_make_stack_executable): Use RETURN_ADDRESS instead of __builtin_return_address.
2003-08-19Update.Ulrich Drepper1-1/+6
2003-08-18 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/shm_open.c (shm_open): Fold EISDIR error into EINVAL.
2002-11-01* include/libc-symbols.h (__libc_freeres_fn_section, libc_freeres_fn):Roland McGrath1-7/+3
New macros. * elf/dl-close.c (free_mem): Use libc_freeres_fn macro, remove text_set_element. * elf/dl-libc.c (free_mem): Likewise. * iconv/gconv_conf.c (free_mem): Likewise. * iconv/gconv_db.c (free_mem): Likewise. * iconv/gconv_dl.c (free_mem): Likewise. * iconv/gconv_cache.c (free_mem): Likewise. * intl/finddomain.c (free_mem): Likewise. * intl/dcigettext.c (free_mem): Likewise. * locale/setlocale.c (free_mem): Likewise. * misc/fstab.c (fstab_free): Likewise. * nss/nsswitch.c (free_mem): Likewise. * posix/regcomp.c (free_mem): Likewise. * resolv/gai_misc.c (free_res): Likewise. * stdlib/fmtmsg.c (free_mem): Likewise. * sunrpc/clnt_perr.c (free_mem): Likewise. * sysdeps/generic/setenv.c (free_mem): Likewise. * sysdeps/unix/sysv/linux/shm_open.c (freeit): Likewise. * sysdeps/pthread/aio_misc.c (free_res): Likewise. * time/tzset.c (free_mem): Likewise. * malloc/mtrace.c (release_libc_mem): Add __libc_freeres_fn_section. * locale/loadarchive.c (_nl_archive_subfreeres): Likewise. * malloc/set-freeres.c (__libc_freeres): Likewise. * login/getutent.c: Include stdlib.h instead of stddef.h. (buffer): Change into pointer to utmp, add libc_freeres_ptr. (__getutent): Allocate buffer the first time it is run. * login/getutid.c: Include stdlib.h instead of stddef.h. (buffer): Change into pointer to utmp, add libc_freeres_ptr. (__getutid): Allocate buffer the first time it is run. * login/getutline.c: Include stdlib.h instead of stddef.h. (buffer): Change into pointer to utmp, add libc_freeres_ptr. (__getutline): Allocate buffer the first time it is run. * malloc/mtrace.c (malloc_trace_buffer): Change into char *. (mtrace): Allocate malloc_trace_buffer. * resolv/nsap_addr.c (inet_nsap_ntoa): Decrease size of tmpbuf. * resolv/ns_print.c (ns_sprintrrf): Decrease size of t. * string/strerror.c: Include libintl.h and errno.h. (buf): New variable. (strerror): Only allocate buffer if actually needed (unknown error). * time/tzfile.c (transitions): Add libc_freeres_ptr. (freeres): Remove. 2002-10-25 Jakub Jelinek <jakub@redhat.com> * include/libc-symbols.h (libc_freeres_ptr): New macro. * malloc/set-freeres.c (__libc_freeres_ptrs): Define using symbol_set_define. (__libc_freeres): Free all pointers in that section. * Makerules (build-shlib): Add $(LDSEDCMD-$(@F:lib%.so=%).so) to sed commands when creating .lds script. (LDSEDCMD-c.so): New variable. * inet/rcmd.c (ahostbuf): Change into char *. Add libc_freeres_ptr. (rcmd_af): Use strdup to allocate ahostbuf. * inet/rexec.c (ahostbuf): Change into char *. Add libc_freeres_ptr. (rexec_af): Use strdup to allocate ahostbuf. * stdio-common/reg-printf.c (printf_funcs): Remove. (__printf_arginfo_table): Change into printf_arginfo_function **. Add libc_freeres_ptr. (__register_printf_function): Allocate __printf_arginfo_table and __printf_function_table the first time it is called. * stdio-common/printf-parse.h (__printf_arginfo_table): Change into printf_arginfo_function **. (parse_one_spec): Add __builtin_expect. * grp/fgetgrent.c (buffer): Add libc_freeres_ptr. (free_mem): Remove. * inet/getnetgrent.c (buffer): Add libc_freeres_ptr. (free_mem): Remove. * intl/localealias.c (libc_freeres_ptr): Define if !_LIBC. (string_space, map): Add libc_freeres_ptr. (free_mem): Remove. * misc/efgcvt.c (FCVT_BUFPTR): Add libc_freeres_ptr. (free_mem): Remove. * misc/mntent.c (getmntent_buffer): Add libc_freeres_ptr. (free_mem): Remove. * crypt/md5-crypt.c (libc_freeres_ptr): Define if !_LIBC. (buffer): Add libc_freeres_ptr. (free_mem): Remove for _LIBC. * nss/getXXbyYY.c (buffer): Add libc_freeres_ptr. (free_mem): Remove. * nss/getXXent.c (buffer): Add libc_freeres_ptr. (free_mem): Remove. * pwd/fgetpwent.c (buffer): Add libc_freeres_ptr. (free_mem): Remove. * resolv/res_hconf.c (ifaddrs): Add libc_freeres_ptr. (free_mem): Remove. * shadow/fgetspent.c (buffer): Add libc_freeres_ptr. (free_mem): Remove. * sysdeps/posix/ttyname.c (getttyname_name): Add libc_freeres_ptr. (free_mem): Remove. * sysdeps/unix/sysv/linux/getsysstats.c (mount_proc): Add libc_freeres_ptr. (free_mem): Remove. * sysdeps/unix/sysv/linux/ttyname.c (getttyname_name, ttyname_buf): Add libc_freeres_ptr. (free_mem): Remove. 2002-10-30 Jakub Jelinek <jakub@redhat.com> * malloc/obstack.c [_LIBC] (obstack_free): Change into strong_alias instead of duplicating the whole function in libc.
2002-09-06(where_is_shmfs): Correct test for filesystem type name of mount points.Ulrich Drepper1-3/+3
2001-07-06Update to LGPL v2.1.Andreas Jaeger1-8/+8
2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
2001-06-05(where_is_shmfs): Recognize tmpfs.Andreas Jaeger1-1/+4
2001-03-30Update.Ulrich Drepper1-2/+2
2001-03-29 Ulrich Drepper <drepper@redhat.com> * math/bits/mathcalls.h: Remove infnan declaration. 2001-03-29 H.J. Lu <hjl@gnu.org> * include/endian.h: Define BIG_ENDI, LITTLE_ENDI, HIGH_HALF, and LOW_HALF only if _LIBC is defined and _ISOMAC is not defined. * stdlib/isomac.c (fmt): Define _LIBC and _ISOMAC. . 2001-03-29 Isamu Hasegawa <isamu@yamato.ibm.com> * posix/regex.c: Fix typo and add a sentinel. 2001-03-29 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/shm_open.c: Open new file always with O_NOFOLLOW. Suggested by Christoph Roland.
2000-12-17Update.Andreas Jaeger1-1/+1
* sysdeps/generic/k_sinl.c (__kernel_sinl): Fix functions parameter. * sysdeps/unix/sysv/linux/shm_open.c (freeit): Make static and add unused attribute to shut up gcc warnings. * sysdeps/generic/k_sinl.c: Include math_private for prototypes. * sysdeps/generic/k_tanl.c: Likewise. * sysdeps/generic/k_cosl.c: Likewise. * sysdeps/generic/e_j0l.c: Likewise. * sysdeps/generic/e_j1l.c: Likewise. * sysdeps/generic/e_jnl.c: Likewise. * sysdeps/generic/e_lgammal_r.c: Likewise.
2000-12-02Remove incorrect comment.Ulrich Drepper1-5/+1
2000-10-18Correct default mount point in comments. (freeit): Remove unnecessary test.Ulrich Drepper1-3/+3
2000-06-09Update.Ulrich Drepper1-2/+10
2000-06-09 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/shm_open.c (where_is_shmfs): Try harder to find correct mount point despite wrong information from the kernel.
2000-06-09Update.Ulrich Drepper1-2/+2
* sysdeps/unix/sysv/linux/shm_open.c (where_is_shmfs): Use defaultdir variable instead of "/var/shm" everywhere. (defaultdir): Change to /dev/shm/.
2000-06-09Update.Ulrich Drepper1-1/+1
2000-06-08 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/shm_open.c (defaultdir): Change to /dev/shm/.
2000-04-15Update.Ulrich Drepper1-6/+1
2000-04-14 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/shm_open.c: Include linux_fsinfo for SHMFS_SUPER_MAGIC. Remove definition of SHMFS_SUPER_MAGIC. * sysdeps/unix/sysv/linux/linux_fsinfo.h (SHMFS_SUPER_MAGIC): Added.
2000-04-12Update.Ulrich Drepper1-1/+24
* sysdeps/unix/sysv/linux/shm_open.c (shm_open): Set FD_CLOEXEC for descriptor.
2000-04-12Update.Ulrich Drepper1-0/+214
* misc/sys/mman.h: Add prototypes for shm_open and shm_unlink. * rt/Makefile (librt-routines): Add shm_open and shm_unlink. * rt/Versions [librt] (GLIBC_2.2): Add shm_open and shm_unlink. * sysdeps/generic/shm_open.c: New file. * sysdeps/generic/shm_unlink.c: New file. * sysdeps/unix/sysv/linux/shm_open.c: New file. * sysdeps/unix/sysv/linux/shm_unlink.c: New file. * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_2.2): Export __endmntent, __getmntent_r, __setmntent, and __statfs.