aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-05-27 22:48:53 +0000
committerIan Lance Taylor <ian@airs.com>1999-05-27 22:48:53 +0000
commit633fd09f3cfd79906b88fc1adcd2c16f39e9848e (patch)
tree222169633012952f6d750a27b4bad5fc6f777922 /bfd/archive.c
parent6da466c730cb814a5903049a922e2169e60a311c (diff)
downloadgdb-633fd09f3cfd79906b88fc1adcd2c16f39e9848e.zip
gdb-633fd09f3cfd79906b88fc1adcd2c16f39e9848e.tar.gz
gdb-633fd09f3cfd79906b88fc1adcd2c16f39e9848e.tar.bz2
* configure.in: Check whether getuid and getgid exist.
* archive.c: Define getuid and getgid as macros if HAVE_GETUID or HAVE_GETGID are not defined, respectively. (bfd_write_armap): Don't special case on _WIN32 for getuid and getgid. * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*. * configure, config.in: Rebuild.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/bfd/archive.c b/bfd/archive.c
index 8ac5aa4..ac5aeaf 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1,5 +1,5 @@
/* BFD back-end for archive files (libraries).
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
@@ -1340,6 +1340,14 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
/** A couple of functions for creating ar_hdrs */
+#ifndef HAVE_GETUID
+#define getuid() 0
+#endif
+
+#ifndef HAVE_GETGID
+#define getgid() 0
+#endif
+
/* Takes a filename, returns an arelt_data for it, or NULL if it can't
make one. The filename must refer to a filename in the filesystem.
The filename field of the ar_hdr will NOT be initialized. If member
@@ -1901,13 +1909,8 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
bfd_ardata (arch)->armap_datepos = (SARMAG
+ offsetof (struct ar_hdr, ar_date[0]));
sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
-#ifndef _WIN32
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
-#else
- sprintf (hdr.ar_uid, "%ld", (long) 666);
- sprintf (hdr.ar_gid, "%ld", (long) 42);
-#endif
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
strncpy (hdr.ar_fmag, ARFMAG, 2);
for (i = 0; i < sizeof (struct ar_hdr); i++)