summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Burridge <rich.burridge@oracle.com>2010-07-15 13:45:49 -0700
committerRich Burridge <rich.burridge@oracle.com>2010-07-15 13:45:49 -0700
commitcc22b130832529204c03214239a57aaadd05101f (patch)
treedcc5bd0451338b3ba21f6e117c30c6ca3e1e3365
parent61694e455782cfdf91b3acf3db84f502546f92e1 (diff)
downloadillumos-joyent-cc22b130832529204c03214239a57aaadd05101f.tar.gz
PSARC 2010/233 EOF SYSV3 SCO compatibility environment variable
6961744 EOF SYSV3 SCO compatibility environment variable
-rw-r--r--usr/src/cmd/Makefile.cmd9
-rw-r--r--usr/src/cmd/echo/Makefile14
-rw-r--r--usr/src/cmd/echo/echo.c35
-rw-r--r--usr/src/cmd/eject/Makefile8
-rw-r--r--usr/src/cmd/expr/Makefile7
-rw-r--r--usr/src/cmd/expr/expr.c50
-rw-r--r--usr/src/cmd/fs.d/Makefile7
-rw-r--r--usr/src/cmd/fs.d/df.c15
-rw-r--r--usr/src/cmd/fstyp/Makefile6
-rw-r--r--usr/src/cmd/sh/Makefile3
-rw-r--r--usr/src/cmd/sh/echo.c29
-rw-r--r--usr/src/cmd/tar/Makefile9
-rw-r--r--usr/src/cmd/tar/tar.c352
-rw-r--r--usr/src/cmd/uname/Makefile13
-rw-r--r--usr/src/cmd/uname/uname.c118
15 files changed, 68 insertions, 607 deletions
diff --git a/usr/src/cmd/Makefile.cmd b/usr/src/cmd/Makefile.cmd
index 6aa89553ae..35fa6c4586 100644
--- a/usr/src/cmd/Makefile.cmd
+++ b/usr/src/cmd/Makefile.cmd
@@ -19,8 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
#
# Definitions common to command source.
#
@@ -501,12 +500,6 @@ TEXT_DOMAIN= SUNW_OST_OSCMD
CLOBBERFILES += $(XPG4) $(XPG6) $(DCFILE)
-# This flag is being added only for SCO (x86) compatibility
-i386_SPFLAG= -D_iBCS2
-sparc_SPFLAG=
-
-iBCS2FLAG = $($(MACH)_SPFLAG)
-
# This flag is for programs which should not build a 32-bit binary
sparc_64ONLY= $(POUND_SIGN)
64ONLY= $($(MACH)_64ONLY)
diff --git a/usr/src/cmd/echo/Makefile b/usr/src/cmd/echo/Makefile
index fbd23ae9c6..afe47998d6 100644
--- a/usr/src/cmd/echo/Makefile
+++ b/usr/src/cmd/echo/Makefile
@@ -2,9 +2,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -19,11 +18,7 @@
#
# CDDL HEADER END
#
-#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
#
PROG= echo
@@ -32,9 +27,6 @@ include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/echo/echo.c b/usr/src/cmd/echo/echo.c
index 1a0cf70682..ebd8e3868b 100644
--- a/usr/src/cmd/echo/echo.c
+++ b/usr/src/cmd/echo/echo.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,12 +19,9 @@
* CDDL HEADER END
*/
/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -47,9 +43,6 @@ main(int argc, char *argv[])
int b_len;
char *ep;
-#ifdef _iBCS2
- int no_nl = 0;
-#endif
(void) setlocale(LC_ALL, "");
if (--argc == 0) {
@@ -59,18 +52,9 @@ main(int argc, char *argv[])
return (0);
}
-#ifdef _iBCS2
- /* If SYSV3 is set, check for ISC/SCO style -n option parsing. */
- if (getenv("SYSV3")) {
- if (strcmp(argv[1], "-n") == 0)
- no_nl ++;
- }
- for (i = 1 + no_nl; i <= argc; i++) {
-#else
for (i = 1; i <= argc; i++) {
-#endif /* _iBCS2 */
for (cp = argv[i], ep = cp + (int)strlen(cp);
- cp < ep; cp += b_len) {
+ cp < ep; cp += b_len) {
if ((b_len = mbtowc(&wc, cp, MB_CUR_MAX)) <= 0) {
(void) putchar(*cp);
b_len = 1;
@@ -124,7 +108,7 @@ main(int argc, char *argv[])
case '0':
j = wd = 0;
while ((*++cp >= '0' && *cp <= '7') &&
- j++ < 3) {
+ j++ < 3) {
wd <<= 3;
wd |= (*cp - '0');
}
@@ -137,12 +121,9 @@ main(int argc, char *argv[])
(void) putchar(*cp);
}
}
-#ifdef _iBCS2
- if (!(no_nl && i == argc))
-#endif /* _iBCS2 */
- (void) putchar(i == argc? '\n': ' ');
- if (fflush(stdout) != 0)
- return (1);
+ (void) putchar(i == argc? '\n': ' ');
+ if (fflush(stdout) != 0)
+ return (1);
}
return (0);
}
diff --git a/usr/src/cmd/eject/Makefile b/usr/src/cmd/eject/Makefile
index 74f00c9c7c..33ae2987a6 100644
--- a/usr/src/cmd/eject/Makefile
+++ b/usr/src/cmd/eject/Makefile
@@ -19,10 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
PROG= eject
@@ -33,9 +30,6 @@ LDLIBS += -lvolmgt -ladm
CFLAGS += $(CCVERBOSE)
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
LINTFLAGS += -um
.KEEP_STATE:
diff --git a/usr/src/cmd/expr/Makefile b/usr/src/cmd/expr/Makefile
index 44e0a20780..8d8aeaa732 100644
--- a/usr/src/cmd/expr/Makefile
+++ b/usr/src/cmd/expr/Makefile
@@ -19,10 +19,8 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
PROG= expr
XPG4PROG= expr
@@ -41,9 +39,6 @@ CFLAGS += $(CCVERBOSE)
$(XPG4) := CFLAGS += -DXPG4
$(XPG6) := CFLAGS += -DXPG6
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
XGETFLAGS += -a -x expr.xcl
LDLIBS += -lgen
diff --git a/usr/src/cmd/expr/expr.c b/usr/src/cmd/expr/expr.c
index 69edad357a..873d7bc3f7 100644
--- a/usr/src/cmd/expr/expr.c
+++ b/usr/src/cmd/expr/expr.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -24,12 +23,9 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdlib.h>
#include <regexpr.h>
#include <locale.h>
@@ -58,11 +54,9 @@
#define REM 272
#define MCH 273
#define MATCH 274
-#ifdef _iBCS2
-#define SUBSTR 276
-#define LENGTH 277
-#define INDEX 278
-#endif /* _iBCS2 */
+#define SUBSTR 275
+#define LENGTH 276
+#define INDEX 277
/* size of subexpression array */
#define MSIZE LINE_MAX
@@ -88,9 +82,6 @@ static int Ac;
static int Argi;
static int noarg;
static int paren;
-#ifdef _iBCS2
-char *sysv3_set;
-#endif /* _iBCS2 */
/*
* Array used to store subexpressions in regular expressions
* Only one subexpression allowed per regular expression currently
@@ -102,23 +93,17 @@ static char *operator[] = {
"|", "&", "+", "-", "*", "/", "%", ":",
"=", "==", "<", "<=", ">", ">=", "!=",
"match",
-#ifdef _iBCS2
"substr", "length", "index",
-#endif /* _iBCS2 */
"\0" };
static int op[] = {
OR, AND, ADD, SUBT, MULT, DIV, REM, MCH,
EQ, EQ, LT, LEQ, GT, GEQ, NEQ,
- MATCH
-#ifdef _iBCS2
-, SUBSTR, LENGTH, INDEX
-#endif /* _iBCS2 */
+ MATCH,
+ SUBSTR, LENGTH, INDEX
};
static int pri[] = {
- 1, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7
-#ifdef _iBCS2
-, 7, 7, 7
-#endif /* _iBCS2 */
+ 1, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7,
+ 7, 7, 7
};
@@ -339,7 +324,6 @@ static char
return (rv);
}
-#ifdef _iBCS2
char *
substr(char *v, char *s, char *w)
{
@@ -387,7 +371,6 @@ length(char *s)
(void) strcpy(rv, ltoa(i));
return (rv);
}
-#endif /* _iBCS2 */
static char *
match(char *s, char *p)
@@ -612,11 +595,7 @@ lop:
return (r1);
}
ylex = yylex();
-#ifdef _iBCS2
- if (ylex > MCH && ((sysv3_set && ylex <= INDEX) || ylex <= MATCH)) {
-#else
- if (ylex > MCH && ylex <= MATCH) {
-#endif /* _iBCS2 */
+ if (ylex > MCH && ylex <= INDEX) {
if (Argi == temp) {
return (r1);
}
@@ -627,7 +606,6 @@ lop:
rb = expres(pri[op1-OR], 0);
ra = expres(pri[op1-OR], 0);
break;
-#ifdef _iBCS2
case SUBSTR:
rc = expres(pri[op1-OR], 0);
rb = expres(pri[op1-OR], 0);
@@ -640,13 +618,11 @@ lop:
rb = expres(pri[op1-OR], 0);
ra = expres(pri[op1-OR], 0);
break;
-#endif /* _iBCS2 */
}
switch (op1) {
case MATCH:
r1 = match(rb, ra);
break;
-#ifdef _iBCS2
case SUBSTR:
r1 = substr(rc, rb, ra);
break;
@@ -656,7 +632,6 @@ lop:
case INDEX:
r1 = index(rb, ra);
break;
-#endif /* _iBCS2 */
}
if (noarg == 1) {
return (r1);
@@ -711,9 +686,6 @@ main(int argc, char **argv)
noarg = 0;
paren = 0;
Av = argv;
-#ifdef _iBCS2
- sysv3_set = getenv("SYSV3");
-#endif /* _iBCS2 */
(void) setlocale(LC_ALL, "");
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
diff --git a/usr/src/cmd/fs.d/Makefile b/usr/src/cmd/fs.d/Makefile
index a2e02bba6a..e5ad91eb6f 100644
--- a/usr/src/cmd/fs.d/Makefile
+++ b/usr/src/cmd/fs.d/Makefile
@@ -18,10 +18,8 @@
#
# CDDL HEADER END
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# cmd/fs.d/Makefile
# The filesystem independent utilities clri, fsdb, dcopy, labelit, and mkfs
# are all built from the source file switchout.c. They are all then links
@@ -78,9 +76,6 @@ SYMETC2USRSBIN = $(ETC2USRSBIN:%=$(ROOTETC)/%)
SYMUSRBIN2USRSBIN= $(USRBIN2USRSBIN:%=$(ROOTBIN)/%)
SYMDEVNM= $(ROOTUSRSBIN)/devnm
-# This flag is being added only for SCO (x86) compatibility
-df.o := CFLAGS += $(iBCS2FLAG)
-
CPPFLAGS += -D_LARGEFILE64_SOURCE
%.xpg4.o := CPPFLAGS += -DXPG4
$(SPPROG) := LDLIBS += -lkstat
diff --git a/usr/src/cmd/fs.d/df.c b/usr/src/cmd/fs.d/df.c
index 489172c05a..9d1d14d595 100644
--- a/usr/src/cmd/fs.d/df.c
+++ b/usr/src/cmd/fs.d/df.c
@@ -210,9 +210,6 @@ static bool_int V_option;
static bool_int P_option; /* Added for XCU4 compliance */
static bool_int Z_option;
static bool_int v_option;
-#ifdef _iBCS2
-char *sysv3_set;
-#endif /* _iBCS2 */
static bool_int a_option;
static bool_int b_option;
static bool_int e_option;
@@ -285,10 +282,6 @@ main(int argc, char *argv[])
program_name = basename(argv[0]);
-#ifdef _iBCS2
- sysv3_set = getenv("SYSV3");
-#endif /* _iBCS2 */
-
if (EQ(program_name, DEVNM_CMD))
do_devnm(argc, argv);
@@ -1572,13 +1565,7 @@ static void
strings_init(void)
{
total_str = TRANSLATE("total");
-#ifdef _iBCS2
- /* ISC/SCO print i-nodes instead of files */
- if (sysv3_set)
- files_str = TRANSLATE("i-nodes");
- else
-#endif /* _iBCS2 */
- files_str = TRANSLATE("files");
+ files_str = TRANSLATE("files");
blocks_str = TRANSLATE("blocks");
kilobytes_str = TRANSLATE("kilobytes");
strings_initialized = TRUE;
diff --git a/usr/src/cmd/fstyp/Makefile b/usr/src/cmd/fstyp/Makefile
index 8482526401..dbd8456ec2 100644
--- a/usr/src/cmd/fstyp/Makefile
+++ b/usr/src/cmd/fstyp/Makefile
@@ -19,8 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
#
PROG= fstyp
@@ -34,9 +33,6 @@ CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
CFLAGS += $(CCVERBOSE)
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/sh/Makefile b/usr/src/cmd/sh/Makefile
index 78db168423..b0741b195b 100644
--- a/usr/src/cmd/sh/Makefile
+++ b/usr/src/cmd/sh/Makefile
@@ -33,9 +33,6 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
#
# for message cataloge
#
diff --git a/usr/src/cmd/sh/echo.c b/usr/src/cmd/sh/echo.c
index 7d7b62bf84..68106b9174 100644
--- a/usr/src/cmd/sh/echo.c
+++ b/usr/src/cmd/sh/echo.c
@@ -47,19 +47,7 @@ echo(int argc, unsigned char **argv)
int len;
wchar_t wc;
-#ifdef _iBCS2 /* SCO compatibility support */
- struct namnod *sysv3;
- int do_sysv3 = 0;
-
- sysv3 = findnam("SYSV3");
- if (sysv3 && (sysv3->namflg & (N_EXPORT | N_ENVNAM)))
- do_sysv3 = 1;
-
- /* Do the -n parsing if sysv3 is set or if ucb_builtsin is set */
- if (ucb_builtins && !do_sysv3) {
-#else
if (ucb_builtins) {
-#endif /* _iBCS2 */
nflg = 0;
if (argc > 1 && argv[1][0] == '-' &&
@@ -88,17 +76,6 @@ echo(int argc, unsigned char **argv)
prc_buff('\n');
exit(0);
}
-#ifdef _iBCS2
- if (do_sysv3) {
- if (argc > 1 && argv[1][0] == '-' &&
- argv[1][1] == 'n' && !argv[1][2]) {
- nflg++;
- /* Step past the -n */
- argc--;
- argv++;
- }
- }
-#endif /* _iBCS2 */
for (i = 1; i <= argc; i++) {
sigchk();
@@ -163,11 +140,7 @@ echo(int argc, unsigned char **argv)
continue;
}
}
-#ifdef _iBCS2
- /* Don't do if don't want newlines & out of args */
- if (!(nflg && i == argc))
-#endif /* _iBCS2 */
- prc_buff(i == argc? '\n': ' ');
+ prc_buff(i == argc? '\n': ' ');
}
exit(0);
}
diff --git a/usr/src/cmd/tar/Makefile b/usr/src/cmd/tar/Makefile
index 15321499d1..5af64596d0 100644
--- a/usr/src/cmd/tar/Makefile
+++ b/usr/src/cmd/tar/Makefile
@@ -19,12 +19,8 @@
# CDDL HEADER END
#
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/tar/Makefile
PROG= tar
DEFAULTFILES= tar.dfl
@@ -42,9 +38,6 @@ LDLIBS += -lsec -lcmdutils -lnvpair -ltsol
CFLAGS += $(CCVERBOSE)
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
CPPFLAGS += -DEUC
ROOTSYMLINK= $(ROOTPROG)
diff --git a/usr/src/cmd/tar/tar.c b/usr/src/cmd/tar/tar.c
index d6cc623331..d6e39db1dd 100644
--- a/usr/src/cmd/tar/tar.c
+++ b/usr/src/cmd/tar/tar.c
@@ -438,13 +438,8 @@ static void delete_target(int fd, char *comp, char *namep);
static void doDirTimes(char *name, timestruc_t modTime);
static void done(int n);
static void dorep(char *argv[]);
-#ifdef _iBCS2
-static void dotable(char *argv[], int cnt);
-static void doxtract(char *argv[], int cnt);
-#else
static void dotable(char *argv[]);
static void doxtract(char *argv[]);
-#endif
static int tar_chdir(const char *path);
static int is_directory(char *name);
static int has_dot_dot(char *name);
@@ -494,10 +489,6 @@ static int build_dblock(const char *, const char *, const char,
const int filetype, const struct stat *, const dev_t, const char *);
static unsigned int hash(char *str);
-#ifdef _iBCS2
-static void initarg(char *argv[], char *file);
-static char *nextarg();
-#endif
static blkcnt_t kcheck(char *kstr);
static off_t bsrch(char *s, int n, off_t l, off_t h);
static void onintr(int sig);
@@ -567,16 +558,12 @@ static struct stat stbuf;
static char *myname;
static int checkflag = 0;
-#ifdef _iBCS2
-static int Fileflag;
-char *sysv3_env;
-#endif
static int Xflag, Fflag, iflag, hflag, Bflag, Iflag;
static int rflag, xflag, vflag, tflag, mt, svmt, cflag, mflag, pflag;
static int uflag;
-static int eflag, errflag, qflag;
+static int errflag;
static int oflag;
-static int bflag, kflag, Aflag;
+static int bflag, Aflag;
static int Pflag; /* POSIX conformant archive */
static int Eflag; /* Allow files greater than 8GB */
static int atflag; /* traverse extended attributes */
@@ -628,7 +615,6 @@ static char archive[] = "archive0=";
static char *Xfile;
static char *usefile;
static char tfname[1024];
-static char *Filefile;
static int mulvol; /* multi-volume option selected */
static blkcnt_t blocklim; /* number of blocks to accept per volume */
@@ -730,10 +716,6 @@ main(int argc, char *argv[])
pid_t pid;
int wstat;
-#ifdef _iBCS2
- int tbl_cnt = 0;
- sysv3_env = getenv("SYSV3");
-#endif
(void) setlocale(LC_ALL, "");
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
@@ -809,15 +791,7 @@ main(int argc, char *argv[])
usefile = *argv++;
break;
case 'F':
-#ifdef _iBCS2
- if (sysv3_env) {
- assert_string(*argv, gettext(
- "tar: 'F' requires a file name\n"));
- Filefile = *argv++;
- Fileflag++;
- } else
-#endif /* _iBCS2 */
- Fflag++;
+ Fflag++;
break;
case 'c':
cflag++;
@@ -891,16 +865,6 @@ main(int argc, char *argv[])
bflag++;
nblock = bcheck(*argv++);
break;
- case 'q':
- qflag++;
- break;
- case 'k':
- assert_string(*argv, gettext(
- "tar: size value must be specified with 'k' "
- "function modifier\n"));
- kflag++;
- blocklim = kcheck(*argv++);
- break;
case 'n': /* not a magtape (instead of 'k') */
NotTape++; /* assume non-magtape */
break;
@@ -908,13 +872,7 @@ main(int argc, char *argv[])
linkerrok++;
break;
case 'e':
-#ifdef _iBCS2
- /* If sysv3 IS set, don't be as verbose */
- if (!sysv3_env)
-#endif /* _iBCS2 */
- errflag++;
- eflag++;
- break;
+ errflag++;
case 'o':
oflag++;
break;
@@ -953,14 +911,6 @@ main(int argc, char *argv[])
usage();
}
-#ifdef _iBCS2
- if (Xflag && Fileflag) {
- (void) fprintf(stderr, gettext(
- "tar: specify only one of X or F.\n"));
- usage();
- }
-#endif /* _iBCS2 */
-
if (!rflag && !xflag && !tflag)
usage();
if ((rflag && xflag) || (xflag && tflag) || (rflag && tflag)) {
@@ -986,7 +936,7 @@ main(int argc, char *argv[])
"the global zone.\n"));
usage();
}
- if (cflag && *argv == NULL && Filefile == NULL)
+ if (cflag && *argv == NULL)
fatal(gettext("Missing filenames"));
if (usefile == NULL)
fatal(gettext("device argument required"));
@@ -1166,14 +1116,6 @@ main(int argc, char *argv[])
Iflag = 1;
argv[argc] = argv[argc+2];
build_table(include_tbl, argv[++argc]);
-#ifdef _iBCS2
- if (Fileflag) {
- (void) fprintf(stderr, gettext(
- "tar: only one of I or F.\n"));
- usage();
- }
-#endif /* _iBCS2 */
-
}
}
}
@@ -1199,18 +1141,9 @@ main(int argc, char *argv[])
(void) printf(gettext(
"Suppressing absolute pathnames.\n"));
-#ifdef _iBCS2
- doxtract(argv, tbl_cnt);
-#else
doxtract(argv);
-#endif
} else if (tflag)
-
-#ifdef _iBCS2
- dotable(argv, tbl_cnt);
-#else
dotable(argv);
-#endif
}
else
usage();
@@ -1224,39 +1157,19 @@ main(int argc, char *argv[])
static void
usage(void)
{
-
-#ifdef _iBCS2
- if (sysv3_env) {
- (void) fprintf(stderr, gettext(
-#if defined(O_XATTR)
-#if defined(_PC_SATTR_ENABLED)
- "Usage: tar {c|r|t|u|x}[BDeEhilmnopPqTvw@/[0-7]][bfFk][X...] "
-#else
- "Usage: tar {c|r|t|u|x}[BDeEhilmnopPqTvw@[0-7]][bfFk][X...] "
-#endif /* _PC_SATTR_ENABLED */
-#else
- "Usage: tar {c|r|t|u|x}[BDeEhilmnopPqTvw[0-7]][bfFk][X...] "
-#endif /* O_XATTR */
- "[j|z|Z] "
- "[blocksize] [tarfile] [filename] [size] [exclude-file...] "
- "{file | -I include-file | -C directory file}...\n"));
- } else
-#endif /* _iBCS2 */
- {
- (void) fprintf(stderr, gettext(
+ (void) fprintf(stderr, gettext(
#if defined(O_XATTR)
#if defined(_PC_SATTR_ENABLED)
- "Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@/[0-7]][bfk][X...] "
+ "Usage: tar {c|r|t|u|x}[BDeEFhilmnopPTvw@/[0-7]][bf][X...] "
#else
- "Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] "
+ "Usage: tar {c|r|t|u|x}[BDeEFhilmnopPTvw@[0-7]][bf][X...] "
#endif /* _PC_SATTR_ENABLED */
#else
- "Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw[0-7]][bfk][X...] "
+ "Usage: tar {c|r|t|u|x}[BDeEFhilmnopPTvw[0-7]][bf][X...] "
#endif /* O_XATTR */
- "[j|z|Z] "
- "[blocksize] [tarfile] [size] [exclude-file...] "
- "{file | -I include-file | -C directory file}...\n"));
- }
+ "[j|z|Z] "
+ "[blocksize] [tarfile] [size] [exclude-file...] "
+ "{file | -I include-file | -C directory file}...\n"));
done(1);
}
@@ -1274,7 +1187,6 @@ dorep(char *argv[])
char wdir[PATH_MAX+2], tempdir[PATH_MAX+2], *parent;
char file[PATH_MAX*2], origdir[PATH_MAX+1];
FILE *fp = (FILE *)NULL;
- FILE *ff = (FILE *)NULL;
int archtype;
int ret;
@@ -1352,19 +1264,6 @@ dorep(char *argv[])
K((blocklim - 1)), K(nblock));
}
-#ifdef _iBCS2
- if (Fileflag) {
- if (Filefile != NULL) {
- if ((ff = fopen(Filefile, "r")) == NULL)
- vperror(0, "%s", Filefile);
- } else {
- (void) fprintf(stderr, gettext(
- "tar: F requires a file name.\n"));
- usage();
- }
- }
-#endif /* _iBCS2 */
-
/*
* Save the original directory before it gets
* changed.
@@ -1376,15 +1275,8 @@ dorep(char *argv[])
(void) strcpy(wdir, origdir);
- while ((*argv || fp || ff) && !term) {
+ while ((*argv || fp) && !term) {
if (fp || (strcmp(*argv, "-I") == 0)) {
-#ifdef _iBCS2
- if (Fileflag) {
- (void) fprintf(stderr, gettext(
- "tar: only one of I or F.\n"));
- usage();
- }
-#endif /* _iBCS2 */
if (fp == NULL) {
if (*++argv == NULL)
fatal(gettext(
@@ -1402,14 +1294,6 @@ dorep(char *argv[])
*p = 0;
}
} else if ((strcmp(*argv, "-C") == 0) && argv[1]) {
-#ifdef _iBCS2
- if (Fileflag) {
- (void) fprintf(stderr, gettext(
- "tar: only one of F or C\n"));
- usage();
- }
-#endif /* _iBCS2 */
-
if (tar_chdir(*++argv) < 0)
vperror(0, gettext(
"can't change directories to %s"), *argv);
@@ -1417,18 +1301,6 @@ dorep(char *argv[])
(void) getcwd(wdir, (sizeof (wdir)));
argv++;
continue;
-#ifdef _iBCS2
- } else if (Fileflag && (ff != NULL)) {
- if ((fgets(file, PATH_MAX-1, ff)) == NULL) {
- (void) fclose(ff);
- ff = NULL;
- continue;
- } else {
- cp = cp2 = file;
- if (p = strchr(cp2, '\n'))
- *p = 0;
- }
-#endif /* _iBCS2 */
} else
cp = cp2 = strcpy(file, *argv++);
@@ -2348,16 +2220,6 @@ putfile(char *longname, char *shortname, char *parent, attr_data_t *attrinfo,
/* correctly handle end of volume */
while (mulvol && tapepos + blocks + 1 > blocklim) {
- /* file won't fit */
- if (eflag) {
- if (blocks <= blocklim) {
- newvol();
- break;
- }
- (void) fprintf(stderr, gettext(
- "tar: Single file cannot fit on volume\n"));
- done(3);
- }
/* split if floppy has some room and file is large */
if (((blocklim - tapepos) >= EXTMIN) &&
((blocks + 1) >= blocklim/10)) {
@@ -2456,16 +2318,6 @@ putfile(char *longname, char *shortname, char *parent, attr_data_t *attrinfo,
tomodes(&stbuf);
while (mulvol && tapepos + blocks + 1 > blocklim) {
- if (eflag) {
- if (blocks <= blocklim) {
- newvol();
- break;
- }
- (void) fprintf(stderr, gettext(
- "tar: Single file cannot fit on volume\n"));
- done(3);
- }
-
if (((blocklim - tapepos) >= EXTMIN) &&
((blocks + 1) >= blocklim/10)) {
splitfile(longname, infile, name,
@@ -2518,16 +2370,6 @@ putfile(char *longname, char *shortname, char *parent, attr_data_t *attrinfo,
tomodes(&stbuf);
while (mulvol && tapepos + blocks + 1 > blocklim) {
- if (eflag) {
- if (blocks <= blocklim) {
- newvol();
- break;
- }
- (void) fprintf(stderr, gettext(
- "tar: Single file cannot fit on volume\n"));
- done(3);
- }
-
if (((blocklim - tapepos) >= EXTMIN) &&
((blocks + 1) >= blocklim/10)) {
splitfile(longname, infile, name,
@@ -2579,16 +2421,6 @@ putfile(char *longname, char *shortname, char *parent, attr_data_t *attrinfo,
tomodes(&stbuf);
while (mulvol && tapepos + blocks + 1 > blocklim) {
- if (eflag) {
- if (blocks <= blocklim) {
- newvol();
- break;
- }
- (void) fprintf(stderr, gettext(
- "tar: Single file cannot fit on volume\n"));
- done(3);
- }
-
if (((blocklim - tapepos) >= EXTMIN) &&
((blocks + 1) >= blocklim/10)) {
splitfile(longname, infile,
@@ -2997,11 +2829,7 @@ open_attr_dir(char *attrname, char *dirp, int cwd, attr_data_t *attrinfo)
#endif
static void
-#ifdef _iBCS2
-doxtract(char *argv[], int tbl_cnt)
-#else
doxtract(char *argv[])
-#endif
{
struct stat xtractbuf; /* stat on file after extracting */
blkcnt_t blocks;
@@ -3044,18 +2872,8 @@ doxtract(char *argv[])
dumping = 0; /* for newvol(), et al: we are not writing */
- /*
- * Count the number of files that are to be extracted
- */
Uid = getuid();
-#ifdef _iBCS2
- initarg(argv, Filefile);
- while (nextarg() != NULL)
- ++fcnt;
- fcnt += tbl_cnt;
-#endif /* _iBCS2 */
-
for (;;) {
convflag = 0;
symflag = 0;
@@ -3732,7 +3550,8 @@ filedone:
}
if (!oflag)
- resugname(dirfd, comp, symflag); /* set file ownership */
+ /* set file ownership */
+ resugname(dirfd, comp, symflag);
if (pflag && newfile == TRUE && !dir &&
(dblock.dbuf.typeflag == '0' ||
@@ -3936,7 +3755,7 @@ filedone:
if (fcnt > xcnt) {
(void) fprintf(stderr,
gettext("tar: %d file(s) not extracted\n"),
- fcnt-xcnt);
+ fcnt-xcnt);
Errflg = 1;
}
}
@@ -4224,15 +4043,10 @@ notsame(void)
}
static void
-#ifdef _iBCS2
-dotable(char *argv[], int tbl_cnt)
-#else
dotable(char *argv[])
-#endif
-
{
- int tcnt; /* count # files tabled */
- int fcnt; /* count # files in argv list */
+ int tcnt = 0; /* count # files tabled */
+ int fcnt = 0; /* count # files in argv list */
char *namep, *dirp, *comp;
int want;
char aclchar = ' '; /* either blank or '+' */
@@ -4249,17 +4063,6 @@ dotable(char *argv[])
nblock = 1;
#endif
}
- /*
- * Count the number of files that are to be tabled
- */
- fcnt = tcnt = 0;
-
-#ifdef _iBCS2
- initarg(argv, Filefile);
- while (nextarg() != NULL)
- ++fcnt;
- fcnt += tbl_cnt;
-#endif /* _iBCS2 */
for (;;) {
@@ -5474,118 +5277,6 @@ copy(void *dst, void *src)
(void) memcpy(dst, src, TBLOCK);
}
-#ifdef _iBCS2
-/*
- * initarg -- initialize things for nextarg.
- *
- * argv filename list, a la argv.
- * filefile name of file containing filenames. Unless doing
- * a create, seeks must be allowable (e.g. no named pipes).
- *
- * - if filefile is non-NULL, it will be used first, and argv will
- * be used when the data in filefile are exhausted.
- * - otherwise argv will be used.
- */
-static char **Cmdargv = NULL;
-static FILE *FILEFile = NULL;
-static long seekFile = -1;
-static char *ptrtoFile, *begofFile, *endofFile;
-
-static void
-initarg(char *argv[], char *filefile)
-{
- struct stat statbuf;
- char *p;
- int nbytes;
-
- Cmdargv = argv;
- if (filefile == NULL)
- return; /* no -F file */
- if (FILEFile != NULL) {
- /*
- * need to REinitialize
- */
- if (seekFile != -1)
- (void) fseek(FILEFile, seekFile, 0);
- ptrtoFile = begofFile;
- return;
- }
- /*
- * first time initialization
- */
- if ((FILEFile = fopen(filefile, "r")) == NULL)
- fatal(gettext("cannot open (%s)"), filefile);
- (void) fstat(fileno(FILEFile), &statbuf);
- if ((statbuf.st_mode & S_IFMT) != S_IFREG) {
- (void) fprintf(stderr, gettext(
- "tar: %s is not a regular file\n"), filefile);
- (void) fclose(FILEFile);
- done(1);
- }
- ptrtoFile = begofFile = endofFile;
- seekFile = 0;
- if (!xflag)
- return; /* the file will be read only once anyway */
- nbytes = statbuf.st_size;
- while ((begofFile = calloc(nbytes, sizeof (char))) == NULL)
- nbytes -= 20;
- if (nbytes < 50) {
- free(begofFile);
- begofFile = endofFile;
- return; /* no room so just do plain reads */
- }
- if (fread(begofFile, 1, nbytes, FILEFile) != nbytes)
- fatal(gettext("could not read %s"), filefile);
- ptrtoFile = begofFile;
- endofFile = begofFile + nbytes;
- for (p = begofFile; p < endofFile; ++p)
- if (*p == '\n')
- *p = '\0';
- if (nbytes != statbuf.st_size)
- seekFile = nbytes + 1;
- else
- (void) fclose(FILEFile);
-}
-
-/*
- * nextarg -- get next argument of arglist.
- *
- * The argument is taken from wherever is appropriate.
- *
- * If the 'F file' function modifier has been specified, the argument
- * will be taken from the file, unless EOF has been reached.
- * Otherwise the argument will be taken from argv.
- *
- * WARNING:
- * Return value may point to static data, whose contents are over-
- * written on each call.
- */
-static char *
-nextarg(void)
-{
- static char nameFile[PATH_MAX + 1];
- int n;
- char *p;
-
- if (FILEFile) {
- if (ptrtoFile < endofFile) {
- p = ptrtoFile;
- while (*ptrtoFile)
- ++ptrtoFile;
- ++ptrtoFile;
- return (p);
- }
- if (fgets(nameFile, PATH_MAX + 1, FILEFile) != NULL) {
- n = strlen(nameFile);
- if (n > 0 && nameFile[n-1] == '\n')
- nameFile[n-1] = '\0';
- return (nameFile);
- }
- }
- return (*Cmdargv++);
-}
-#endif /* _iBCS2 */
-
/*
* kcheck()
* - checks the validity of size values for non-tape devices
@@ -5608,10 +5299,9 @@ kcheck(char *kstr)
(void) fprintf(stderr, gettext(
"tar: sizes below %luK not supported (%" FMT_blkcnt_t
").\n"), (ulong_t)MINSIZE, kval);
- if (!kflag)
- (void) fprintf(stderr, gettext(
- "bad size entry for %s in %s.\n"),
- archive, DEF_FILE);
+ (void) fprintf(stderr, gettext(
+ "bad size entry for %s in %s.\n"),
+ archive, DEF_FILE);
done(1);
}
mulvol++;
diff --git a/usr/src/cmd/uname/Makefile b/usr/src/cmd/uname/Makefile
index f40b513136..723e597cc0 100644
--- a/usr/src/cmd/uname/Makefile
+++ b/usr/src/cmd/uname/Makefile
@@ -2,9 +2,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -20,10 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
#
PROG= uname
@@ -33,9 +29,6 @@ include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
-# This flag is being added only for SCO (x86) compatibility
-CFLAGS += $(iBCS2FLAG)
-
.KEEP_STATE:
all: $(ROOTFS_PROG)
diff --git a/usr/src/cmd/uname/uname.c b/usr/src/cmd/uname/uname.c
index 59d99a184e..2c43b50cd6 100644
--- a/usr/src/cmd/uname/uname.c
+++ b/usr/src/cmd/uname/uname.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -37,8 +35,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#define __EXTENSIONS__
#include <sys/types.h>
#include <stdio.h>
@@ -55,10 +51,6 @@
static void usage(void);
-#ifdef _iBCS2
-char *sysv3_env;
-#endif /* _iBCS2 */
-
/* ARGSUSED */
int
main(int argc, char *argv[], char *envp[])
@@ -69,12 +61,6 @@ main(int argc, char *argv[], char *envp[])
int pflg = 0, iflg = 0, Sflg = 0;
int errflg = 0, optlet;
int Xflg = 0;
-#ifdef _iBCS2
- char *ptr;
- char *newptr;
- int cnt;
- int done;
-#endif /* _iBCS2 */
struct utsname unstr, *un;
char fmt_string[] = " %.*s";
char *fs = &fmt_string[1];
@@ -84,73 +70,6 @@ main(int argc, char *argv[], char *envp[])
un = &unstr;
(void) uname(un);
-#ifdef _iBCS2
- /* Find out if user wants SYS V behavior */
- if (sysv3_env = getenv("SYSV3")) {
-
- /*
- * Now figure out what values are encoded in sysv3
- * Tokens are comma separated:
- * os, sysname, nodename, release, version, machtype
- */
- cnt = 0;
- ptr = sysv3_env;
- done = 0;
- while (!done && *ptr) {
- if ((newptr = strchr(ptr, ',')) == (char *)0)
- done = 1;
- else
- /* Null out the comma */
- *newptr = '\0';
-
- /* If ptr == newptr, there was no data for this token */
- if (ptr == newptr) {
- /* Step over null token and go around again */
- ptr = newptr + 1;
- cnt ++;
- continue;
- }
-
- switch (cnt++) {
- case 0:
- /* Ignore the os token for now. */
- break;
- case 1:
- strcpy(un->sysname, ptr);
- break;
- case 2:
- strcpy(un->nodename, ptr);
- break;
- case 3:
- strcpy(un->release, ptr);
- break;
- case 4:
- strcpy(un->version, ptr);
- break;
- case 5:
- strcpy(un->machine, ptr);
- break;
- default:
- done = 1;
- break;
- }
- ptr = newptr + 1;
- }
-
- /*
- * If SYSV3 is set to an empty string, fill in the structure
- * with reasonable default values.
- */
- if (!cnt) {
- strcpy(un->sysname, un->nodename);
- strcpy(un->release, "3.2");
- strcpy(un->version, "2");
- strcpy(un->machine, "i386");
- }
- }
-
-#endif /* _iBCS2 */
-
(void) setlocale(LC_ALL, "");
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
@@ -161,17 +80,8 @@ main(int argc, char *argv[], char *envp[])
switch (optlet) {
case 'a':
sflg++; nflg++; rflg++; vflg++; mflg++;
-#ifdef _iBCS2
- /*
- * If compat mode, don't print things ISC
- * doesn't have
- */
- if (!sysv3_env)
-#endif /* _iBCS2 */
- {
- pflg++;
- iflg++;
- }
+ pflg++;
+ iflg++;
break;
case 's':
sflg++;
@@ -211,7 +121,7 @@ main(int argc, char *argv[], char *envp[])
if ((Sflg > 1) ||
(Sflg && (sflg || nflg || rflg || vflg || mflg || pflg || iflg ||
- Xflg))) {
+ Xflg))) {
usage();
}
@@ -221,15 +131,15 @@ main(int argc, char *argv[], char *envp[])
if (len > SYS_NMLN - 1) {
(void) fprintf(stderr, gettext(
- "uname: name must be <= %d letters\n"),
- SYS_NMLN-1);
+ "uname: name must be <= %d letters\n"),
+ SYS_NMLN-1);
exit(1);
}
if (sysinfo(SI_SET_HOSTNAME, nodename, len) < 0) {
int err = errno;
(void) fprintf(stderr, gettext(
- "uname: error in setting name: %s\n"),
- strerror(err));
+ "uname: error in setting name: %s\n"),
+ strerror(err));
exit(1);
}
return (0);
@@ -264,7 +174,7 @@ main(int argc, char *argv[], char *envp[])
if (pflg) {
if (sysinfo(SI_ARCHITECTURE, procbuf, sizeof (procbuf)) == -1) {
(void) fprintf(stderr, gettext(
- "uname: sysinfo failed\n"));
+ "uname: sysinfo failed\n"));
exit(1);
}
(void) fprintf(stdout, fs, strlen(procbuf), procbuf);
@@ -273,7 +183,7 @@ main(int argc, char *argv[], char *envp[])
if (iflg) {
if (sysinfo(SI_PLATFORM, procbuf, sizeof (procbuf)) == -1) {
(void) fprintf(stderr, gettext(
- "uname: sysinfo failed\n"));
+ "uname: sysinfo failed\n"));
exit(1);
}
(void) fprintf(stdout, fs, strlen(procbuf), procbuf);
@@ -314,8 +224,8 @@ usage(void)
{
{
(void) fprintf(stderr, gettext(
- "usage: uname [-snrvmapiX]\n"
- " uname [-S system_name]\n"));
+ "usage: uname [-snrvmapiX]\n"
+ " uname [-S system_name]\n"));
}
exit(1);
}