Xref: utzoo comp.sources.bugs:2474 comp.lang.perl:2031 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.sources.bugs,comp.lang.perl Subject: perl 3.0 patch #20 Summary: This is an official patch for perl 3.0. Please apply it. Message-ID: <9098@jpl-devvax.JPL.NASA.GOV> Date: 10 Aug 90 21:26:59 GMT Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 1580 System: perl version 3.0 Patch #: 20 Priority: Subject: patch #19, continued Description: See patch #19. Fix: From rn, say "| patch -p -N -d DIR", where DIR is your perl source directory. Outside of rn, say "cd DIR; patch -p -N #define PATCHLEVEL 20 Index: os2/README.OS2 *** os2/README.OS2.old Thu Aug 9 06:02:17 1990 --- os2/README.OS2 Thu Aug 9 06:02:18 1990 *************** *** 0 **** --- 1,275 ---- + + Notes on the OS/2 Perl port + + Raymond Chen + (rjc@math.princeton.edu) + + -1. Background. + + This port was based on the MS-DOS port by Diomidis Spinellis. + + 0. Set-up. + + First copy the files in the os2 directory into the parent + directory. Also install the file msdos/dir.h in your include + directory. + + 1. Compiling. + + Perl has been compiled under MS-DOS using the Microsoft C compiler + version 6.0. Before compiling install dir.h as . You will + need a Unix-like make program and something like yacc (e.g. bison). I + just ran yacc on my UNIX box and downloaded the resulting y.tab.[ch] + files. Compilation takes 45 minutes on a 16MHz 386 machine running + no jobs other than the compiler, so you will probably need something to + do in the meantime. Like, say, lunch. (Compilation time does not + include formatting the manual.) If you compile with optimization + turned off, it takes about half as long. + + The executable is 270k (perlsym.exe is 473k; if you compile + without optimization, the sizes are 329K/531K), and the top level + directory needs 800K for sources, 550K for object code, and 800K for the + executables, assuming you want to build both perl.exe and perlsym.exe + with full optimization. + + The makefile will compile glob for you which you will need to place + somewhere in your path so that perl globbing will work correctly. All + the tests were run, although some modifications were necessary because + OS/2 isn't UNIX. The tests that failed failed because of limitations of + the operating system and aren't the fault of the compiler. a2p and s2p + were not tested. + + In the eg directory you will find the syscalls.pl header file, + and a sample program that demonstrates some of the improvements + of the OS/2 version over the MS-DOS version and some of the + system calls. + + 2. Using OS/2 Perl + + The OS/2 version of perl has much of the functionality of the Unix + version. Here are some things that don't work: sockets, password + functions, [gs]et[eug]id, dbm functions, fork. + + One thing that doesn't work is "split" with no arguments. Somehow, + yylval.arg is empty ... [[ Wait, sorry, I fixed that. --rjc ]] + + Care has been taken to implement the rest, although the implementation + might not be the best possible. Here are short notes on the tricky + bits: + + 2.1. In-place editing. + + Files currently can be edited in-place provided you are creating a + backup. Considerable effort is made to ensure that a reasonable + name for the backup is selected, while still remaining within + the 8.3 contraints of the FAT filesystem. (HPFS users have nothing + to worry about, since HPFS doesn't have the stupid 8.3 rule.) + + The rules for how OS/2 perl combines your filename with the suffix + (the thing passed to "-i") are rather complicated, but the basic + idea is that the "obvious" name is chosen. + + Here are the rules: + + Style 0: Append the suffix exactly as UNIX perl would do it. + If the filesystem likes it, use it. (HPFS will always + swallow it. FAT will rarely accept it.) + + Style 1: If the suffix begins with a '.', change the file extension + to whatever you supplied. If the name matches the original + name, use the fallback method. + + Style 2: If the suffix is a single character, not a '.', try to add the + suffix to the following places, using the first one that works. + [1] Append to extension. + [2] Append to filename, + [3] Replace end of extension, + [4] Replace end of filename. + If the name matches the original name, use the fallback method. + + Style 3: Any other case: Ignore the suffix completely and use the + fallback method. + + Fallback method: Change the extension to ".$$$". If that matches the + original name, then change the extension to ".~~~". + + If filename is more than 1000 characters long, we die a horrible + death. Sorry. + + Examples, assuming style 0 failed. + + suffix = ".bak" (style 1) + foo.bar => foo.bak + foo.bak => foo.$$$ (fallback) + foo.$$$ => foo.~~~ (fallback) + makefile => makefile.bak + + suffix = "~" (style 2) + foo.c => foo.c~ + foo.c~ => foo.c~~ + foo.c~~ => foo~.c~~ + foo~.c~~ => foo~~.c~~ + foo~~~~~.c~~ => foo~~~~~.$$$ (fallback) + + foo.pas => foo~.pas + makefile => makefile.~ + longname.fil => longname.fi~ + longname.fi~ => longnam~.fi~ + longnam~.fi~ => longnam~.$$$ + + 2.2. Directory access. + + Are implemented, but in order to support telldir() and seekdir(), + they operate by reading in the entire directory at opendir(), + then handing out pieces of it each time you do a readdir(). + + 2.3. Pipes and redirection. + + Pipes and redirection are supported. Although OS/2 does not + terminate programs which try to write to closed pipes, perl will + kill them for you if you do it like this: + + open(I, "long-running-program|"); + ... process a few lines ... + close(I); # discard the rest ... + + The killing works like this: We wait until the child program either + closes its stdout or tries to write to it. If it writes to its stdout, + we kill it. Otherwise, we cwait for it. This is pretty much what UNIX + does by default. + + All pipe commands are given to cmd.exe (or your COMSPEC) for execution as + + CMD /c your-command-line + + so you can go ahead and load it up with any goofy things you want, + like 2>1 redirection, more pipes, && || etc. + + The pipe() function is also supported, so you can go ahead and + make your own funky file descriptor connections before piping off + a process. However, you have to mark the descriptor you are + retaining as NOINHERIT before spawning, else you are in deadlock city. + Unfortunately, there's no way to mark the handle as NOINHERIT yet. + It's on my wish list. + + 2.4. Syscall and Ioctl + + IOCtl is not supported because the API is very different from the + UNIX API. Instead, IOCtl is supported as a syscall. Here are + the syscalls I've written so far: + + $OS2_GetVersion = 0; + $OS2_Shutdown = 1; + $OS2_Beep = 2; + $OS2_PhysicalDisk = 3; + $OS2_Config = 4; + $OS2_IOCtl = 5; + $OS2_QCurDisk = 6; + $OS2_SelectDisk = 7; + $OS2_SetMaxFH = 8; + $OS2_Sleep = 9; + $OS2_StartSession = 10; + $OS2_StopSession = 11; + $OS2_SelectSession = 12; + + The arguments you pass are handed off to OS/2 without interpretation, + and the return value is returned straight to you. However, you don't + have to supply arguments for the ones whose descriptions are "must be + zero"; perl will supply the mandatory zeros for you. + + 2.5. Binary file access + + Files are opened in text mode by default. This means that CR LF pairs + are translated to LF. If binary access is needed the `binarymode' + function should be used. There is currently no way to reverse the + effect of the binary function. If that is needed close and reopen the + file. + + 2.6. Priority + + The getpriority and setpriority functions are implemented, but since + OS/2 priorities are different from UNIX priorities, the arguments aren't + the same. Basically, the arguments you pass are handed directly to + OS/2. The only exception is the last argument to setpriority. To make + it easier to make delta priorities, if the priority class is 0xff, it + is changed to 0. That way, you can write + + setpriority(0,0,-2) + + instead of + + setpriority(0,0,0xfe) + + to decrease the delta by 2. + + 2.7. Interpreter startup. + + The effect of the Unix #!/bin/perl interpreter startup can be obtained + under OS/2 by giving the script a .cmd extension and beginning the script + with the line + + extproc C:\binp\perl.exe -S + + You should provide the appropriate path to your executable, and + the -S option is necessary so that perl can find your script. + + 2.8. The kill function. + + UNIX and OS/2 have different ideas about the kill function. I've + done a pretty feeble job of taking perl's UNIXish approach and + trying to jam it into the OS/2 way. No doubt you'll find that + your kill()s aren't working. My apologies in advance. + + 3. Bug reports. + + I don't normally have access to an OS/2 machine, so if you find + a bug, you can go ahead and tell me about it, but the odds that + I'd be able to fix it are slim. + + 4. Wish list. + + 4.1. OS/2. + + Make ENOPIPE a fatal error. + + Permit linking of files. (Allegedly, they're working on this.) + + Get a fork. + + Make CMD.EXE pass through the return code of its child. + + 4.2 perl. + + Provide a nice way to add new functions to perl without having + to understand the innards of perl. Not being fluent in perl + innards hacking, I added my extra functions via syscall. + + 4.3. My port. + + 4.3.1. In-place editing. + + Make more idiot-proof. + + Allow in-place editing without backup. (How?) + + 4.3.2. Spawning and piping. + + Make popen() cleverer. Currently, it blindly hands everything + off to CMD.EXE. This wastes an exec if the command line didn't + have any shell metacharacters and if the program being run + is not a batch file. + + Clever spawning is carried out by do_spawn. We should try + to make popen() do much of the same sort of preprocessing + as do_spawn does (which means, of course, that we probably + should yank out code to be dished off into a subroutine). + + In do_spawn(), use DosExecPgm instead of spawnl in order to get more + precise reasons why the child terminated (RESULTCODES). + + + July 1990 + + Raymond Chen + 1817 Oxford St. Apt 6 + Berkeley, CA 94709-1828 USA Index: msdos/README.msdos *** msdos/README.msdos.old Thu Aug 9 06:01:34 1990 --- msdos/README.msdos Thu Aug 9 06:01:35 1990 *************** *** 39,44 **** --- 39,59 ---- ing pipes, but excluding the pipe function), system, ioctl and sleep have been provided. + [Files currently can be edited in-place provided you are cre- + ating a backup. However, if the backup coincidentally has + the same name as the original, or if the resulting backup + filename is invalid, then the file will probably be trashed. + For example, don't do + + perl -i~ script makefile + perl -i.bak script file.dat + + because (1) MS-DOS treats "makefile~" and "makefile" as the + same filename, and (2) "file.dat.bak" is an invalid filename. + The files "makefile" and "file.dat" will probably be lost + forever. Moral of the story: Don't use in-place editing + under MS-DOS. --rjc] + 2.1. Interface to the MS-DOS ioctl system call. The function code of the ioctl function (the second Index: x2p/a2p.y Prereq: 3.0.1.1 *** x2p/a2p.y.old Thu Aug 9 06:06:52 1990 --- x2p/a2p.y Thu Aug 9 06:06:54 1990 *************** *** 1,5 **** %{ ! /* $Header: a2p.y,v 3.0.1.1 90/03/01 10:30:08 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,5 ---- %{ ! /* $Header: a2p.y,v 3.0.1.2 90/08/09 05:47:26 lwall Locked $ * * Copyright (c) 1989, Larry Wall * *************** *** 7,12 **** --- 7,15 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: a2p.y,v $ + * Revision 3.0.1.2 90/08/09 05:47:26 lwall + * patch19: a2p didn't handle {foo = (bar == 123)} + * * Revision 3.0.1.1 90/03/01 10:30:08 lwall * patch9: a2p didn't allow logical expressions everywhere it should * *************** *** 137,143 **** { $$ = $1; } | expr term { $$ = oper2(OCONCAT,$1,$2); } ! | variable ASGNOP expr { $$ = oper3(OASSIGN,$2,$1,$3); if ((ops[$1].ival & 255) == OFLD) lval_field = TRUE; --- 140,146 ---- { $$ = $1; } | expr term { $$ = oper2(OCONCAT,$1,$2); } ! | variable ASGNOP cond { $$ = oper3(OASSIGN,$2,$1,$3); if ((ops[$1].ival & 255) == OFLD) lval_field = TRUE; *************** *** 167,173 **** | term IN VAR { $$ = oper2(ODEFINED,aryrefarg($3),$1); } | term '?' term ':' term ! { $$ = oper2(OCOND,$1,$3,$5); } | variable INCR { $$ = oper1(OPOSTINCR,$1); } | variable DECR --- 170,176 ---- | term IN VAR { $$ = oper2(ODEFINED,aryrefarg($3),$1); } | term '?' term ':' term ! { $$ = oper3(OCOND,$1,$3,$5); } | variable INCR { $$ = oper1(OPOSTINCR,$1); } | variable DECR Index: x2p/a2py.c Prereq: 3.0 *** x2p/a2py.c.old Thu Aug 9 06:06:59 1990 --- x2p/a2py.c Thu Aug 9 06:07:00 1990 *************** *** 1,4 **** ! /* $Header: a2py.c,v 3.0 89/10/18 15:34:35 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $Header: a2py.c,v 3.0.1.1 90/08/09 05:48:53 lwall Locked $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,14 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: a2py.c,v $ + * Revision 3.0.1.1 90/08/09 05:48:53 lwall + * patch19: a2p didn't emit a chop when NF was referenced though split needs it + * * Revision 3.0 89/10/18 15:34:35 lwall * 3.0 baseline * *************** *** 578,584 **** case 'n': case 'N': SNARFWORD; if (strEQ(d,"NF")) ! do_split = split_to_array = set_array_base = TRUE; if (strEQ(d,"next")) { saw_line_op = TRUE; XTERM(NEXT); --- 581,587 ---- case 'n': case 'N': SNARFWORD; if (strEQ(d,"NF")) ! do_chop = do_split = split_to_array = set_array_base = TRUE; if (strEQ(d,"next")) { saw_line_op = TRUE; XTERM(NEXT); Index: arg.h Prereq: 3.0.1.5 *** arg.h.old Thu Aug 9 05:56:15 1990 --- arg.h Thu Aug 9 05:56:17 1990 *************** *** 1,4 **** ! /* $Header: arg.h,v 3.0.1.5 90/03/27 15:29:41 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $Header: arg.h,v 3.0.1.6 90/08/09 02:25:14 lwall Locked $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,15 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: arg.h,v $ + * Revision 3.0.1.6 90/08/09 02:25:14 lwall + * patch19: added require operator + * patch19: added truncate operator + * * Revision 3.0.1.5 90/03/27 15:29:41 lwall * patch16: MSDOS support * *************** *** 210,216 **** #define O_SEND 180 #define O_RECV 181 #define O_SSELECT 182 ! #define O_SOCKETPAIR 183 #define O_DBSUBR 184 #define O_DEFINED 185 #define O_UNDEF 186 --- 214,220 ---- #define O_SEND 180 #define O_RECV 181 #define O_SSELECT 182 ! #define O_SOCKPAIR 183 #define O_DBSUBR 184 #define O_DEFINED 185 #define O_UNDEF 186 *************** *** 271,277 **** #define O_LSLICE 241 #define O_SPLICE 242 #define O_BINMODE 243 ! #define MAXO 244 #ifndef DOINIT extern char *opname[]; --- 275,283 ---- #define O_LSLICE 241 #define O_SPLICE 242 #define O_BINMODE 243 ! #define O_REQUIRE 244 ! #define O_TRUNCATE 245 ! #define MAXO 246 #ifndef DOINIT extern char *opname[]; *************** *** 460,466 **** "SEND", "RECV", "SSELECT", ! "SOCKETPAIR", "DBSUBR", "DEFINED", "UNDEF", --- 466,472 ---- "SEND", "RECV", "SSELECT", ! "SOCKPAIR", "DBSUBR", "DEFINED", "UNDEF", *************** *** 521,527 **** "LSLICE", "SPLICE", "BINMODE", ! "244" }; #endif --- 527,535 ---- "LSLICE", "SPLICE", "BINMODE", ! "REQUIRE", ! "TRUNCATE", ! "245" }; #endif *************** *** 837,843 **** A(1,1,3), /* SEND */ A(1,1,1), /* RECV */ A(1,1,1), /* SSELECT */ ! A(1,1,1), /* SOCKETPAIR */ A(0,3,0), /* DBSUBR */ A(1,0,0), /* DEFINED */ A(1,0,0), /* UNDEF */ --- 845,851 ---- A(1,1,3), /* SEND */ A(1,1,1), /* RECV */ A(1,1,1), /* SSELECT */ ! A(1,1,1), /* SOCKPAIR */ A(0,3,0), /* DBSUBR */ A(1,0,0), /* DEFINED */ A(1,0,0), /* UNDEF */ *************** *** 848,854 **** A(0,1,0), /* LAELEM */ A(0,1,0), /* LHELEM */ A(1,0,0), /* LOCAL */ ! A(0,0,0), /* PIPE */ A(1,0,0), /* FILENO */ A(1,0,0), /* GHBYNAME */ A(1,1,0), /* GHBYADDR */ --- 856,862 ---- A(0,1,0), /* LAELEM */ A(0,1,0), /* LHELEM */ A(1,0,0), /* LOCAL */ ! A(1,1,0), /* PIPE */ A(1,0,0), /* FILENO */ A(1,0,0), /* GHBYNAME */ A(1,1,0), /* GHBYADDR */ *************** *** 898,903 **** --- 906,913 ---- A(0,3,3), /* LSLICE */ A(0,3,1), /* SPLICE */ A(1,0,0), /* BINMODE */ + A(1,0,0), /* REQUIRE */ + A(1,1,0), /* TRUNCATE */ 0 }; #undef A Index: t/base.lex Prereq: 3.0 *** t/base.lex.old Thu Aug 9 06:05:55 1990 --- t/base.lex Thu Aug 9 06:05:55 1990 *************** *** 1,6 **** #!./perl ! # $Header: base.lex,v 3.0 89/10/18 15:24:24 lwall Locked $ print "1..18\n"; --- 1,6 ---- #!./perl ! # $Header: base.lex,v 3.0.1.1 90/08/09 05:24:43 lwall Locked $ print "1..18\n"; *************** *** 34,40 **** eval '$foo = 123+123.4+123e4+123.4E5+123.4e+5+.12;'; $foo = int($foo * 100 + .5); ! if ($foo eq 2591024652) {print "ok 7\n";} else {print "not ok 7\n";} print <<'EOF'; ok 8 --- 34,40 ---- eval '$foo = 123+123.4+123e4+123.4E5+123.4e+5+.12;'; $foo = int($foo * 100 + .5); ! if ($foo eq 2591024652) {print "ok 7\n";} else {print "not ok 7 :$foo:\n";} print <<'EOF'; ok 8 Index: h2pl/cbreak.pl *** h2pl/cbreak.pl.old Thu Aug 9 05:59:22 1990 --- h2pl/cbreak.pl Thu Aug 9 05:59:23 1990 *************** *** 0 **** --- 1,34 ---- + $sgttyb_t = 'C4 S'; + + sub cbreak { + &set_cbreak(1); + } + + sub cooked { + &set_cbreak(0); + } + + sub set_cbreak { + local($on) = @_; + + require 'sizeof.ph'; + require 'sys/ioctl.ph'; + + ioctl(STDIN,&TIOCGETP,$sgttyb) + || die "Can't ioctl TIOCGETP: $!"; + + @ary = unpack($sgttyb_t,$sgttyb); + if ($on) { + $ary[4] |= &CBREAK; + $ary[4] &= ~&ECHO; + } else { + $ary[4] &= ~&CBREAK; + $ary[4] |= &ECHO; + } + $sgttyb = pack($sgttyb_t,@ary); + ioctl(STDIN,&TIOCSETP,$sgttyb) + || die "Can't ioctl TIOCSETP: $!"; + + } + + 1; Index: h2pl/cbreak2.pl *** h2pl/cbreak2.pl.old Thu Aug 9 05:59:26 1990 --- h2pl/cbreak2.pl Thu Aug 9 05:59:27 1990 *************** *** 0 **** --- 1,33 ---- + $sgttyb_t = 'C4 S'; + + sub cbreak { + &set_cbreak(1); + } + + sub cooked { + &set_cbreak(0); + } + + sub set_cbreak { + local($on) = @_; + + require 'sys/ioctl.pl'; + + ioctl(STDIN,$TIOCGETP,$sgttyb) + || die "Can't ioctl TIOCGETP: $!"; + + @ary = unpack($sgttyb_t,$sgttyb); + if ($on) { + $ary[4] |= $CBREAK; + $ary[4] &= ~$ECHO; + } else { + $ary[4] &= ~$CBREAK; + $ary[4] |= $ECHO; + } + $sgttyb = pack($sgttyb_t,@ary); + ioctl(STDIN,$TIOCSETP,$sgttyb) + || die "Can't ioctl TIOCSETP: $!"; + + } + + 1; Index: cmd.c Prereq: 3.0.1.7 *** cmd.c.old Thu Aug 9 05:56:28 1990 --- cmd.c Thu Aug 9 05:56:33 1990 *************** *** 1,4 **** ! /* $Header: cmd.c,v 3.0.1.7 90/03/27 15:32:37 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $Header: cmd.c,v 3.0.1.8 90/08/09 02:28:49 lwall Locked $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,16 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: cmd.c,v $ + * Revision 3.0.1.8 90/08/09 02:28:49 lwall + * patch19: did preliminary work toward debugging packages and evals + * patch19: conditionals now always supply a scalar context to expression + * patch19: switch optimizer was confused by negative fractional values + * * Revision 3.0.1.7 90/03/27 15:32:37 lwall * patch16: non-terminal blocks should never have arrays requested of them * *************** *** 301,307 **** /* Set line number so run-time errors can be located */ ! line = cmd->c_line; #ifdef DEBUGGING if (debug) { --- 306,312 ---- /* Set line number so run-time errors can be located */ ! curcmd = cmd; #ifdef DEBUGGING if (debug) { *************** *** 615,621 **** lastretstr = retstr; while (tmps_max > tmps_base) /* clean up after last eval */ str_free(tmps_list[tmps_max--]); ! newsp = eval(cmd->c_expr,gimme && (cmdflags & CF_TERM),sp); st = stack->ary_array; /* possibly reallocated */ retstr = st[newsp]; if (newsp > sp && retstr) --- 620,629 ---- lastretstr = retstr; while (tmps_max > tmps_base) /* clean up after last eval */ str_free(tmps_list[tmps_max--]); ! newsp = eval(cmd->c_expr, ! gimme && (cmdflags & CF_TERM) && cmd->c_type == C_EXPR && ! !cmd->ucmd.acmd.ac_expr, ! sp); st = stack->ary_array; /* possibly reallocated */ retstr = st[newsp]; if (newsp > sp && retstr) *************** *** 680,686 **** } break; case C_NSWITCH: ! match = (int)str_gnum(STAB_STR(cmd->c_stab)); goto doswitch; case C_CSWITCH: match = *(str_get(STAB_STR(cmd->c_stab))) & 255; --- 688,702 ---- } break; case C_NSWITCH: ! { ! double value = str_gnum(STAB_STR(cmd->c_stab)); ! ! match = (int)value; ! if (value < 0.0) { ! if (((double)match) > value) ! --match; /* was fractional--truncate other way */ ! } ! } goto doswitch; case C_CSWITCH: match = *(str_get(STAB_STR(cmd->c_stab))) & 255; *************** *** 901,907 **** { register int i; ! fprintf(stderr,"%-4ld",(long)line); for (i=0; ic_line); for (i=0; ic_line); for (i=0; i rather than . We can't just say + * -I/usr/include/sys because some systems have both time files, and + * the -I trick gets the wrong one. + */ + /* I_SYSTIME: + * This symbol is defined if this system has the file . + */ + /* + * I_TIME: + * This symbol is defined if time this system has the file . + */ + /*#undef TMINSYS /**/ + /*#define I_SYSTIME /**/ + #define I_TIME + + /* VARARGS: + * This symbol, if defined, indicates to the C program that it should + * include varargs.h. + */ + #define VARARGS /**/ + + /* vfork: + * This symbol, if defined, remaps the vfork routine to fork if the + * vfork() routine isn't supported here. + */ + /*#undef vfork fork /**/ + + /* VOIDSIG: + * This symbol is defined if this system declares "void (*signal())()" in + * signal.h. The old way was to declare it as "int (*signal())()". It + * is up to the package author to declare things correctly based on the + * symbol. + */ + #define VOIDSIG /**/ + + /* VPRINTF: + * This symbol, if defined, indicates that the vprintf routine is available + * to printf with a pointer to an argument list. If unavailable, you + * may need to write your own, probably in terms of _doprnt(). + */ + /* CHARVSPRINTF: + * This symbol is defined if this system has vsprintf() returning type + * (char*). The trend seems to be to declare it as "int vsprintf()". It + * is up to the package author to declare vsprintf correctly based on the + * symbol. + */ + #define VPRINTF /**/ + /*#undef CHARVSPRINTF /**/ + + /* GIDTYPE: + * This symbol has a value like gid_t, int, ushort, or whatever type is + * used to declare group ids in the kernel. + */ + /* TODO */ + #define GIDTYPE int /**/ + + /* I_DIRENT: + * This symbol, if defined, indicates to the C program that it should + * include dirent.h. + */ + /* DIRNAMLEN: + * This symbol, if defined, indicates to the C program that the length + * of directory entry names is provided by a d_namlen field. Otherwise + * you need to do strlen() on the d_name field. + */ + /*#undef I_DIRENT /**/ + #define DIRNAMLEN /**/ + + /* I_FCNTL: + * This symbol, if defined, indicates to the C program that it should + * include fcntl.h. + */ + #define I_FCNTL /**/ + + /* I_GRP: + * This symbol, if defined, indicates to the C program that it should + * include grp.h. + */ + /*#define I_GRP /**/ + + /* I_PWD: + * This symbol, if defined, indicates to the C program that it should + * include pwd.h. + */ + /* PWQUOTA: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_quota. + */ + /* PWAGE: + * This symbol, if defined, indicates to the C program that struct passwd + * contains pw_age. + */ + /*#define I_PWD /**/ + /*#define PWQUOTA /**/ + /*#undef PWAGE /**/ + + /* I_SYSDIR: + * This symbol, if defined, indicates to the C program that it should + * include sys/dir.h. + */ + #define I_SYSDIR /**/ + + /* I_SYSIOCTL: + * This symbol, if defined, indicates that sys/ioctl.h exists and should + * be included. + */ + /*#define I_SYSIOCTL /**/ + + /* I_VARARGS: + * This symbol, if defined, indicates to the C program that it should + * include varargs.h. + */ + #define I_VARARGS /**/ + + /* INTSIZE: + * This symbol contains the size of an int, so that the C preprocessor + * can make decisions based on it. + */ + #define INTSIZE 2 /**/ + + /* RANDBITS: + * This symbol contains the number of bits of random number the rand() + * function produces. Usual values are 15, 16, and 31. + */ + #define RANDBITS 31 /**/ + + /* SIG_NAME: + * This symbol contains an list of signal names in order. + */ + #ifdef OS2 + #define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","IOT","EMT","FPE",\ + /* 0 1 2 3 4 5 6 7 8 */\ + "KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM","USR1","USR2","CLD",\ + /* 9 10 11 12 13 14 15 16 17 18 */\ + "PWR","USR3","BREAK","ABRT" + /*19 20 21 22 */ + #else + #define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","IOT","EMT","FPE","KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM","URG","STOP","TSTP","CONT","CHLD","TTIN","TTOU","IO","XCPU","XFSZ","VTALRM","PROF","WINCH","USR1","USR2" /**/ + #endif /* OS2 */ + + /* STDCHAR: + * This symbol is defined to be the type of char used in stdio.h. + * It has the values "unsigned char" or "char". + */ + #define STDCHAR char /**/ + + /* UIDTYPE: + * This symbol has a value like uid_t, int, ushort, or whatever type is + * used to declare user ids in the kernel. + */ + #define UIDTYPE int /**/ + + /* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. + */ + #ifndef VOIDUSED + #define VOIDUSED 7 + #endif + #define VOIDFLAGS 7 + #if (VOIDFLAGS & VOIDUSED) != VOIDUSED + #define void int /* is void to be avoided? */ + #define M_VOID /* Xenix strikes again */ + #endif + + /* PRIVLIB: + * This symbol contains the name of the private library for this package. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. The program + * should be prepared to do ^ expansion. + */ + #define PRIVLIB "/usr/local/lib/perl" /**/ + + /* + * BUGGY_MSC: + * This symbol is defined if you are the unfortunate owner of a buggy + * Microsoft C compiler and want to use intrinsic functions. Versions + * up to 5.1 are known conform to this definition. + */ + /*#define BUGGY_MSC /**/ + + /* + * BINARY: + * This symbol is defined if you run under an operating system that + * distinguishes between binary and text files. If so the function + * setmode will be used to set the file into binary mode. + */ + #define BINARY + + #define S_ISUID 0 + #define S_ISGID 0 + #define CASTNEGFLOAT Index: config_h.SH *** config_h.SH.old Thu Aug 9 05:56:48 1990 --- config_h.SH Thu Aug 9 05:56:50 1990 *************** *** 97,102 **** --- 97,108 ---- */ #$d_charsprf CHARSPRINTF /**/ + /* CHSIZE: + * This symbol, if defined, indicates that the chsize routine is available + * to truncate files. You might need a -lx to get this routine. + */ + #$d_chsize CHSIZE /**/ + /* CRYPT: * This symbol, if defined, indicates that the crypt routine is available * to encrypt passwords and the like. *************** *** 288,293 **** --- 294,305 ---- */ #$d_rmdir RMDIR /**/ + /* SELECT: + * This symbol, if defined, indicates that the select routine is available + * to select active file descriptors. + */ + #$d_select SELECT /**/ + /* SETEGID: * This symbol, if defined, indicates that the setegid routine is available * to change the effective gid of the current program. *************** *** 409,414 **** --- 421,432 ---- */ #$d_syscall SYSCALL /**/ + /* TRUNCATE: + * This symbol, if defined, indicates that the truncate routine is + * available to truncate files. + */ + #$d_truncate TRUNCATE /**/ + /* VARARGS: * This symbol, if defined, indicates to the C program that it should * include varargs.h. *************** *** 581,586 **** --- 599,611 ---- * function produces. Usual values are 15, 16, and 31. */ #define RANDBITS $randbits /**/ + + /* SCRIPTDIR: + * This symbol holds the name of the directory in which the user wants + * to put publicly executable scripts for the package in question. It + * is often a directory that is mounted across diverse architectures. + */ + #define SCRIPTDIR "$scriptdir" /**/ /* SIG_NAME: * This symbol contains an list of signal names in order. *** End of Patch 20 ***