Retire sysuname(2), synchronize sys/utsname.h

Now that uname(3) uses sysctl(2), we no longer need sysuname(2).
Backward compatibility is retained for old statically linked
binaries for a short while.

Also remove the now-obsolete MINIX3-specific "arch" field from the
utsname structure.  While this is an ABI break at the libc level,
it should pose no problems in practice, because:

- statically linked programs (i.e., all of the base system) are not
  affected, as they will use headers synchronized with libc;
- the structure is getting smaller, thus, older dynamically linked
  programs (typically in pkgsrc) using the new libc will end up with
  garbage in the "arch" field, but it is unlikely they will use this
  field anyway, since it was specific to MINIX3;
- new dynamically linked programs using an old libc could end up with
  memory corruption, but this is not a scenario that is expected to
  occur in the first place - certainly not with programs from pkgsrc.

Change-Id: I29c76576f509feacc8f996f0bd353ca8961d4917
This commit is contained in:
David van Moolenbroek
2015-10-09 18:34:38 +00:00
committed by Lionel Sambuc
parent d2532d3d42
commit d991a2bea3
7 changed files with 14 additions and 167 deletions

View File

@@ -51,37 +51,12 @@ struct utsname {
char release[_SYS_NMLN]; /* Release level. */
char version[_SYS_NMLN]; /* Version level. */
char machine[_SYS_NMLN]; /* Hardware type. */
#if defined(__minix)
char arch[_SYS_NMLN];
#endif /* defined(__minix) */
};
#include <sys/cdefs.h>
__BEGIN_DECLS
int uname(struct utsname *);
#if defined(__minix)
#include <sys/types.h>
int sysuname(int _req, int _field, char *_value, size_t _len);
#endif /* defined(__minix) */
__END_DECLS
#if defined(__minix)
/* req: Get or set a string. */
#define _UTS_GET 0
#define _UTS_SET 1
/* field: What field to get or set. These values can't be changed lightly. */
#define _UTS_ARCH 0
#define _UTS_KERNEL 1
#define _UTS_MACHINE 2
#define _UTS_HOSTNAME 3
#define _UTS_NODENAME 4
#define _UTS_RELEASE 5
#define _UTS_VERSION 6
#define _UTS_SYSNAME 7
#define _UTS_BUS 8
#define _UTS_MAX 9 /* Number of strings. */
#endif /* defined(__minix) */
#endif /* !_SYS_UTSNAME_H_ */