1 /* Miscellaneous support functions for dynamic linker
2 Copyright (C) 1997 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)
54 /* Map a copy of the file contents. */
55 result
= __mmap (0, st
.st_size
, prot
,
65 if (result
== (void *) -1)
76 _dl_sysdep_fatal (const char *msg
, ...)
83 size_t len
= strlen (msg
);
84 __write (STDERR_FILENO
, msg
, len
);
85 msg
= va_arg (ap
, const char *);
94 _dl_sysdep_error (const char *msg
, ...)
101 size_t len
= strlen (msg
);
102 __write (STDERR_FILENO
, msg
, len
);
103 msg
= va_arg (ap
, const char *);
110 _dl_sysdep_message (const char *msg
, ...)
117 size_t len
= strlen (msg
);
118 __write (STDOUT_FILENO
, msg
, len
);
119 msg
= va_arg (ap
, const char *);