]>
sourceware.org Git - glibc.git/blob - elf/dl-misc.c
90288525f4b7cc5ef81c02648f336cd5521fbf46
1 /* Miscellaneous support functions for dynamic linker
2 Copyright (C) 1997, 1998 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
29 /* This is the only dl-sysdep.c function that is actually needed at run-time
33 _dl_sysdep_open_zero_fill (void)
35 return __open ("/dev/zero", O_RDONLY
);
39 /* Read the whole contents of FILE into new mmap'd space with given
40 protections. *SIZEP gets the size of the file. */
43 _dl_sysdep_read_whole_file (const char *file
, size_t *sizep
, int prot
)
47 int fd
= __open (file
, O_RDONLY
);
50 if (__fxstat (_STAT_VER
, fd
, &st
) < 0
51 /* No need to map the file if it is empty. */
56 /* Map a copy of the file contents. */
57 result
= __mmap (0, st
.st_size
, prot
,
67 if (result
== MAP_FAILED
)
77 /* Descriptor to write debug messages to. */
82 _dl_sysdep_output (int fd
, const char *msg
, ...)
89 size_t len
= strlen (msg
);
90 __write (fd
, msg
, len
);
91 msg
= va_arg (ap
, const char *);
This page took 0.039691 seconds and 4 git commands to generate.