diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 20 | ||||
-rw-r--r-- | win32/bin/exetype.pl | 75 | ||||
-rw-r--r-- | win32/config.bc | 25 | ||||
-rw-r--r-- | win32/config.gc | 25 | ||||
-rw-r--r-- | win32/config.vc | 27 | ||||
-rw-r--r-- | win32/config_H.bc | 105 | ||||
-rw-r--r-- | win32/config_H.gc | 105 | ||||
-rw-r--r-- | win32/config_H.vc | 105 | ||||
-rw-r--r-- | win32/makefile.mk | 42 | ||||
-rw-r--r-- | win32/perlhost.h | 7 | ||||
-rw-r--r-- | win32/vdir.h | 212 | ||||
-rw-r--r-- | win32/win32.c | 31 | ||||
-rw-r--r-- | win32/win32.h | 9 |
13 files changed, 648 insertions, 140 deletions
diff --git a/win32/Makefile b/win32/Makefile index 6bf5e6ec33..4203378ec4 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -29,7 +29,7 @@ INST_TOP = $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -INST_VER = \5.5.650 +INST_VER = \5.5.660 # # Comment this out if you DON'T want your perl installation to have @@ -471,6 +471,7 @@ UTILS = \ ..\pod\podselect \ ..\x2p\find2perl \ ..\x2p\s2p \ + bin\exetype.pl \ bin\runperl.pl \ bin\pl2bat.pl \ bin\perlglob.pl \ @@ -620,7 +621,8 @@ SETARGV_OBJ = setargv$(o) !ENDIF DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \ - Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob + Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \ + Sys/Hostname STATIC_EXT = DynaLoader NONXS_EXT = Errno @@ -641,6 +643,7 @@ PEEK = $(EXTDIR)\Devel\Peek\Peek BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader DPROF = $(EXTDIR)\Devel\DProf\DProf GLOB = $(EXTDIR)\File\Glob\Glob +HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll @@ -657,6 +660,7 @@ RE_DLL = $(AUTODIR)\re\re.dll BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll +HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll ERRNO_PM = $(LIBDIR)\Errno.pm @@ -675,7 +679,8 @@ EXTENSION_C = \ $(B).c \ $(BYTELOADER).c \ $(DPROF).c \ - $(GLOB).c + $(GLOB).c \ + $(HOSTNAME).c EXTENSION_DLL = \ $(SOCKET_DLL) \ @@ -692,7 +697,8 @@ EXTENSION_DLL = \ $(THREAD_DLL) \ $(BYTELOADER_DLL) \ $(DPROF_DLL) \ - $(GLOB_DLL) + $(GLOB_DLL) \ + $(HOSTNAME_DLL) EXTENSION_PM = \ $(ERRNO_PM) @@ -957,6 +963,12 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs $(MAKE) cd ..\..\win32 +$(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs + cd $(EXTDIR)\Sys\$(*B) + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\..\win32 + $(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs cd $(EXTDIR)\$(*B) ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl diff --git a/win32/bin/exetype.pl b/win32/bin/exetype.pl index 5846b3ee3b..27e3b94bc8 100644 --- a/win32/bin/exetype.pl +++ b/win32/bin/exetype.pl @@ -1,26 +1,60 @@ #!perl -w use strict; -unless (@ARGV == 2) { - print "Usage: $0 exefile [CONSOLE|WINDOWS]\n"; + +# All the IMAGE_* structures are defined in the WINNT.H file +# of the Microsoft Platform SDK. + +my %subsys = (NATIVE => 1, + WINDOWS => 2, + CONSOLE => 3, + POSIX => 7, + WINDOWSCE => 9); + +unless (0 < @ARGV && @ARGV < 3) { + printf "Usage: $0 exefile [%s]\n", join '|', sort keys %subsys; exit; } -unless ($ARGV[1] =~ /^(console|windows)$/i) { - print "Invalid subsystem $ARGV[1], please use CONSOLE or WINDOWS\n"; + +$ARGV[1] = uc $ARGV[1] if $ARGV[1]; +unless (@ARGV == 1 || defined $subsys{$ARGV[1]}) { + (my $subsys = join(', ', sort keys %subsys)) =~ s/, (\w+)$/ or $1/; + print "Invalid subsystem $ARGV[1], please use $subsys\n"; exit; } -my ($record,$magic,$offset,$size); -open EXE, "+< $ARGV[0]" or die "Cannot open $ARGV[0]: $!"; + +my ($record,$magic,$signature,$offset,$size); +open EXE, "+< $ARGV[0]" or die "Cannot open $ARGV[0]: $!\n"; binmode EXE; -read EXE, $record, 32*4; + +# read IMAGE_DOS_HEADER structure +read EXE, $record, 64; ($magic,$offset) = unpack "Sx58L", $record; -die "Not an MSDOS executable file" unless $magic == 0x5a4d; + +die "$ARGV[0] is not an MSDOS executable file.\n" + unless $magic == 0x5a4d; # "MZ" + +# read signature, IMAGE_FILE_HEADER and first WORD of IMAGE_OPTIONAL_HEADER seek EXE, $offset, 0; -read EXE, $record, 24; -($magic,$size) = unpack "Lx16S", $record; -die "PE header not found" unless $magic == 0x4550; -die "Optional header not in NT32 format" unless $size == 224; -seek EXE, $offset+24+68, 0; -print EXE pack "S", uc($ARGV[1]) eq 'CONSOLE' ? 3 : 2; +read EXE, $record, 4+20+2; +($signature,$size,$magic) = unpack "Lx16Sx2S", $record; + +die "PE header not found" unless $signature == 0x4550; # "PE\0\0" + +die "Optional header is neither in NT32 nor in NT64 format" + unless ($size == 224 && $magic == 0x10b) || # IMAGE_NT_OPTIONAL_HDR32_MAGIC + ($size == 240 && $magic == 0x20b); # IMAGE_NT_OPTIONAL_HDR64_MAGIC + +# Offset 68 in the IMAGE_OPTIONAL_HEADER(32|64) is the 16 bit subsystem code +seek EXE, $offset+4+20+68, 0; +if (@ARGV == 1) { + read EXE, $record, 2; + my ($subsys) = unpack "S", $record; + $subsys = {reverse %subsys}->{$subsys} || "UNKNOWN($subsys)"; + print "$ARGV[0] uses the $subsys subsystem.\n"; +} +else { + print EXE pack "S", $subsys{$ARGV[1]}; +} close EXE; __END__ @@ -52,6 +86,19 @@ use a console supplied by the operating system. The WINDOWS subsystem handles an application that does not require a console and creates its own windows, if required. +=item NATIVE + +The NATIVE subsystem handles a Windows NT device driver. + +=item WINDOWSCE + +The WINDOWSCE subsystem handles Windows CE consumer electronics +applications. + +=item POSIX + +The POSIX subsystem handles a POSIX application in Windows NT. + =back =head1 AUTHOR diff --git a/win32/config.bc b/win32/config.bc index fd70a3f560..fe321aaccd 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -147,6 +147,8 @@ d_fstatfs='undef' d_fstatvfs='undef' d_ftello='undef' d_ftime='define' +d_getcwd='undef' +d_getfsstat='undef' d_getgrent='undef' d_getgrps='undef' d_gethbyaddr='define' @@ -164,13 +166,13 @@ d_getnetprotos='undef' d_getpbyname='define' d_getpbynumber='define' d_getpent='undef' -d_getpwent='undef' d_getpgid='undef' d_getpgrp2='undef' d_getpgrp='undef' d_getppid='undef' d_getprior='undef' d_getprotoprotos='define' +d_getpwent='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='undef' @@ -178,23 +180,25 @@ d_getservprotos='define' d_getspent='undef' d_getspnam='undef' d_gettimeod='undef' +d_gnulibc='undef' d_grpasswd='undef' d_hasmntopt='undef' -d_gnulibc='undef' d_htonl='define' d_index='undef' d_inetaton='undef' d_int64t='undef' d_isascii='define' d_killpg='undef' -d_ldbl_dig='define' d_lchown='undef' +d_ldbl_dig='define' d_link='define' d_locconv='define' d_lockf='undef' d_longdbl='define' d_longlong='undef' +d_lseekproto='define' d_lstat='undef' +d_madvise='undef' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' @@ -204,8 +208,13 @@ d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' +d_mkdtemp='undef' d_mkfifo='undef' +d_mkstemp='undef' +d_mkstemps='undef' d_mktime='define' +d_mmap='undef' +d_mprotect='undef' d_msg='undef' d_msg_ctrunc='undef' d_msg_dontroute='undef' @@ -216,6 +225,8 @@ d_msgctl='undef' d_msgget='undef' d_msgrcv='undef' d_msgsnd='undef' +d_msync='undef' +d_munmap='undef' d_mymalloc='undef' d_nice='undef' d_off64_t='undef' @@ -262,7 +273,6 @@ d_seteuid='undef' d_setgrent='undef' d_setgrps='undef' d_sethent='undef' -d_setpwent='undef' d_setlinebuf='undef' d_setlocale='define' d_setnent='undef' @@ -271,6 +281,7 @@ d_setpgid='undef' d_setpgrp2='undef' d_setpgrp='undef' d_setprior='undef' +d_setpwent='undef' d_setregid='undef' d_setresgid='undef' d_setresuid='undef' @@ -540,6 +551,7 @@ man3ext='3' medium='' mips_type='' mkdir='mkdir' +mmaptype='void *' models='none' modetype='mode_t' more='more /e' @@ -646,6 +658,7 @@ small='' so='dll' sockethdr='' socketlib='' +socksizetype='int' sort='sort' spackage='Perl5' spitshell='' @@ -693,12 +706,12 @@ uname='uname' uniq='uniq' uquadtype='unsigned __int64' use5005threads='undef' -use64bits='undef' +use64bitall='undef' +use64bitint='undef' usedl='define' useithreads='undef' uselargefiles='undef' uselongdouble='undef' -uselonglong='undef' usemorebits='undef' usemultiplicity='undef' usemymalloc='n' diff --git a/win32/config.gc b/win32/config.gc index 10a1c778f9..9c6f1f6dce 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -147,6 +147,8 @@ d_fstatfs='undef' d_fstatvfs='undef' d_ftello='undef' d_ftime='define' +d_getcwd='undef' +d_getfsstat='undef' d_getgrent='undef' d_getgrps='undef' d_gethbyaddr='define' @@ -164,13 +166,13 @@ d_getnetprotos='undef' d_getpbyname='define' d_getpbynumber='define' d_getpent='undef' -d_getpwent='undef' d_getpgid='undef' d_getpgrp2='undef' d_getpgrp='undef' d_getppid='undef' d_getprior='undef' d_getprotoprotos='define' +d_getpwent='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='undef' @@ -178,23 +180,25 @@ d_getservprotos='define' d_getspent='undef' d_getspnam='undef' d_gettimeod='undef' +d_gnulibc='undef' d_grpasswd='undef' d_hasmntopt='undef' -d_gnulibc='undef' d_htonl='define' d_index='undef' d_inetaton='undef' d_int64t='undef' d_isascii='define' d_killpg='undef' -d_ldbl_dig='define' d_lchown='undef' +d_ldbl_dig='define' d_link='define' d_locconv='define' d_lockf='undef' d_longdbl='define' d_longlong='undef' +d_lseekproto='define' d_lstat='undef' +d_madvise='undef' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' @@ -204,8 +208,13 @@ d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' +d_mkdtemp='undef' d_mkfifo='undef' +d_mkstemp='undef' +d_mkstemps='undef' d_mktime='define' +d_mmap='undef' +d_mprotect='undef' d_msg='undef' d_msg_ctrunc='undef' d_msg_dontroute='undef' @@ -216,6 +225,8 @@ d_msgctl='undef' d_msgget='undef' d_msgrcv='undef' d_msgsnd='undef' +d_msync='undef' +d_munmap='undef' d_mymalloc='undef' d_nice='undef' d_off64_t='undef' @@ -262,7 +273,6 @@ d_seteuid='undef' d_setgrent='undef' d_setgrps='undef' d_sethent='undef' -d_setpwent='undef' d_setlinebuf='undef' d_setlocale='define' d_setnent='undef' @@ -271,6 +281,7 @@ d_setpgid='undef' d_setpgrp2='undef' d_setpgrp='undef' d_setprior='undef' +d_setpwent='undef' d_setregid='undef' d_setresgid='undef' d_setresuid='undef' @@ -540,6 +551,7 @@ man3ext='3' medium='' mips_type='' mkdir='mkdir' +mmaptype='void *' models='none' modetype='mode_t' more='more /e' @@ -646,6 +658,7 @@ small='' so='dll' sockethdr='' socketlib='' +socksizetype='int' sort='sort' spackage='Perl5' spitshell='' @@ -693,12 +706,12 @@ uname='uname' uniq='uniq' uquadtype='unsigned long long' use5005threads='undef' -use64bits='undef' +use64bitall='undef' +use64bitint='undef' usedl='define' useithreads='undef' uselargefiles='undef' uselongdouble='undef' -uselonglong='undef' usemorebits='undef' usemultiplicity='undef' usemymalloc='n' diff --git a/win32/config.vc b/win32/config.vc index 5514827e86..ed981567fb 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -147,6 +147,8 @@ d_fstatfs='undef' d_fstatvfs='undef' d_ftello='undef' d_ftime='define' +d_getcwd='undef' +d_getfsstat='undef' d_getgrent='undef' d_getgrps='undef' d_gethbyaddr='define' @@ -164,13 +166,13 @@ d_getnetprotos='undef' d_getpbyname='define' d_getpbynumber='define' d_getpent='undef' -d_getpwent='undef' d_getpgid='undef' d_getpgrp2='undef' d_getpgrp='undef' d_getppid='undef' d_getprior='undef' d_getprotoprotos='define' +d_getpwent='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='undef' @@ -178,23 +180,25 @@ d_getservprotos='define' d_getspent='undef' d_getspnam='undef' d_gettimeod='undef' +d_gnulibc='undef' d_grpasswd='undef' d_hasmntopt='undef' -d_gnulibc='undef' d_htonl='define' d_index='undef' d_inetaton='undef' d_int64t='undef' d_isascii='define' d_killpg='undef' -d_ldbl_dig='define' d_lchown='undef' +d_ldbl_dig='define' d_link='define' d_locconv='define' d_lockf='undef' d_longdbl='define' d_longlong='undef' +d_lseekproto='define' d_lstat='undef' +d_madvise='undef' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' @@ -204,8 +208,13 @@ d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' +d_mkdtemp='undef' d_mkfifo='undef' +d_mkstemp='undef' +d_mkstemps='undef' d_mktime='define' +d_mmap='undef' +d_mprotect='undef' d_msg='undef' d_msg_ctrunc='undef' d_msg_dontroute='undef' @@ -216,6 +225,8 @@ d_msgctl='undef' d_msgget='undef' d_msgrcv='undef' d_msgsnd='undef' +d_msync='undef' +d_munmap='undef' d_mymalloc='undef' d_nice='undef' d_off64_t='undef' @@ -262,7 +273,6 @@ d_seteuid='undef' d_setgrent='undef' d_setgrps='undef' d_sethent='undef' -d_setpwent='undef' d_setlinebuf='undef' d_setlocale='define' d_setnent='undef' @@ -271,6 +281,7 @@ d_setpgid='undef' d_setpgrp2='undef' d_setpgrp='undef' d_setprior='undef' +d_setpwent='undef' d_setregid='undef' d_setresgid='undef' d_setresuid='undef' @@ -540,6 +551,7 @@ man3ext='3' medium='' mips_type='' mkdir='mkdir' +mmaptype='void *' models='none' modetype='mode_t' more='more /e' @@ -646,6 +658,7 @@ small='' so='dll' sockethdr='' socketlib='' +socksizetype='int' sort='sort' spackage='Perl5' spitshell='' @@ -693,12 +706,12 @@ uname='uname' uniq='uniq' uquadtype='unsigned __int64' use5005threads='undef' -use64bits='undef' +use64bitall='undef' +use64bitint='undef' usedl='define' useithreads='undef' uselargefiles='undef' uselongdouble='undef' -uselonglong='undef' usemorebits='undef' usemultiplicity='undef' usemymalloc='n' @@ -732,8 +745,8 @@ xlibpth='/usr/lib/386 /lib/386' zcat='' zip='zip' PERL_REVISION='~PERL_REVISION~' -PERL_VERSION='~PERL_VERSION~' PERL_SUBVERSION='~PERL_SUBVERSION~' +PERL_VERSION='~PERL_VERSION~' PERL_API_REVISION='~PERL_API_REVISION~' PERL_API_SUBVERSION='~PERL_API_SUBVERSION~' PERL_API_VERSION='~PERL_API_VERSION~' diff --git a/win32/config_H.bc b/win32/config_H.bc index e89f71eecd..868e9a35d6 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -293,6 +293,12 @@ */ /*#define HAS_LSTAT /**/ +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise routine is + * available to hint about the expected access behavior. + */ +/*#define HAS_MADVISE /**/ + /* HAS_MBLEN: * This symbol, if defined, indicates that the mblen routine is available * to find the number of bytes in a multibye character. @@ -344,6 +350,12 @@ */ #define HAS_MKDIR /**/ +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + /* HAS_MKFIFO: * This symbol, if defined, indicates that the mkfifo routine is * available to create FIFOs. Otherwise, mknod should be able to @@ -352,6 +364,20 @@ */ /*#define HAS_MKFIFO /**/ +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * extemporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to exclusively create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + /* HAS_MKTIME: * This symbol, if defined, indicates that the mktime routine is * available. @@ -1082,7 +1108,7 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "c:\\perl\\5.5.650\\lib\\MSWin32-x86" /**/ +#define ARCHLIB "c:\\perl\\5.5.660\\lib\\MSWin32-x86" /**/ /*#define ARCHLIB_EXP "" /**/ /* ARCHNAME: @@ -1113,8 +1139,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ -#define BIN_EXP "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ +#define BIN "c:\\perl\\5.5.660\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.5.660\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: * This symbol, if defined, indicates that Perl 5.006 should be @@ -1338,6 +1364,7 @@ * available to stat filesystems by file descriptors. */ /*#define HAS_FSTATFS /**/ + /* HAS_FTELLO: * This symbol, if defined, indicates that the ftello routine is * available to ftell beyond 32 bits (useful for ILP32 hosts). @@ -1361,6 +1388,18 @@ */ #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. + */ +/*#define HAS_GETCWD /**/ + +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems in bulk. + */ +/*#define HAS_GETFSSTAT /**/ + /* HAS_GETGRENT: * This symbol, if defined, indicates that the getgrent routine is * available for sequential access of the group database. @@ -1608,6 +1647,14 @@ #define LONGLONGSIZE 8 /**/ #endif +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek _((int, off_t, int)); + */ +#define HAS_LSEEK_PROTO /**/ + /* HAS_MEMCHR: * This symbol, if defined, indicates that the memchr routine is available * to locate characters within a C string. @@ -1836,6 +1883,12 @@ /*#define HAS_MSG_PROXY /**/ /*#define HAS_SCM_RIGHTS /**/ +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + /* HAS_SQRTL: * This symbol, if defined, indicates that the sqrtl routine is * available to do long double square roots. @@ -2540,8 +2593,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5.5.650\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.5.650")) /**/ +#define PRIVLIB "c:\\perl\\5.5.660\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.5.660")) /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -2639,7 +2692,7 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.5.650\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.5.660\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -2657,8 +2710,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\site\\5.5.650\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.5.650")) /**/ +#define SITELIB "c:\\perl\\site\\5.5.660\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.5.660")) /**/ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2713,19 +2766,35 @@ */ #define Uid_t uid_t /* UID type */ -/* USE_64_BITS: +/* USE_64_BIT_ALL: + * This variable conditionally defines the USE_64_BIT_ALL symbol, + * and indicates that 64-bit integer types should be used + * when available. The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_INT. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_64_BIT_INT: * This symbol, if defined, indicates that 64-bit integers should * be used when available. If not defined, the native integers - * will be used (be they 32 or 64 bits). + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. */ -#ifndef USE_64_BITS -/*#define USE_64_BITS /**/ +#ifndef USE_64_BIT_INT +/*#define USE_64_BIT_INT /**/ #endif /* USE_LARGE_FILES: * This symbol, if defined, indicates that large file support - * should be used when available. The USE_64_BITS symbol will - * also be turned on if necessary. + * should be used when available. */ #ifndef USE_LARGE_FILES /*#define USE_LARGE_FILES /**/ @@ -2739,14 +2808,6 @@ /*#define USE_LONG_DOUBLE /**/ #endif -/* USE_LONG_LONG: - * This symbol, if defined, indicates that long longs should - * be used when available. - */ -#ifndef USE_LONG_LONG -/*#define USE_LONG_LONG /**/ -#endif - #ifndef USE_MORE_BITS /*#define USE_MORE_BITS /**/ #endif diff --git a/win32/config_H.gc b/win32/config_H.gc index d9adb8f8d7..e3ce507097 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -293,6 +293,12 @@ */ /*#define HAS_LSTAT /**/ +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise routine is + * available to hint about the expected access behavior. + */ +/*#define HAS_MADVISE /**/ + /* HAS_MBLEN: * This symbol, if defined, indicates that the mblen routine is available * to find the number of bytes in a multibye character. @@ -344,6 +350,12 @@ */ #define HAS_MKDIR /**/ +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + /* HAS_MKFIFO: * This symbol, if defined, indicates that the mkfifo routine is * available to create FIFOs. Otherwise, mknod should be able to @@ -352,6 +364,20 @@ */ /*#define HAS_MKFIFO /**/ +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * temporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to exclusively create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + /* HAS_MKTIME: * This symbol, if defined, indicates that the mktime routine is * available. @@ -1082,7 +1108,7 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "c:\\perl\\5.5.650\\lib\\MSWin32-x86" /**/ +#define ARCHLIB "c:\\perl\\5.5.660\\lib\\MSWin32-x86" /**/ /*#define ARCHLIB_EXP "" /**/ /* ARCHNAME: @@ -1113,8 +1139,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ -#define BIN_EXP "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ +#define BIN "c:\\perl\\5.5.660\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.5.660\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: * This symbol, if defined, indicates that Perl 5.006 should be @@ -1338,6 +1364,7 @@ * available to stat filesystems by file descriptors. */ /*#define HAS_FSTATFS /**/ + /* HAS_FTELLO: * This symbol, if defined, indicates that the ftello routine is * available to ftell beyond 32 bits (useful for ILP32 hosts). @@ -1361,6 +1388,18 @@ */ #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. + */ +/*#define HAS_GETCWD /**/ + +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems in bulk. + */ +/*#define HAS_GETFSSTAT /**/ + /* HAS_GETGRENT: * This symbol, if defined, indicates that the getgrent routine is * available for sequential access of the group database. @@ -1608,6 +1647,14 @@ #define LONGLONGSIZE 8 /**/ #endif +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek _((int, off_t, int)); + */ +#define HAS_LSEEK_PROTO /**/ + /* HAS_MEMCHR: * This symbol, if defined, indicates that the memchr routine is available * to locate characters within a C string. @@ -1836,6 +1883,12 @@ /*#define HAS_MSG_PROXY /**/ /*#define HAS_SCM_RIGHTS /**/ +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + /* HAS_SQRTL: * This symbol, if defined, indicates that the sqrtl routine is * available to do long double square roots. @@ -2540,8 +2593,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5.5.650\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.5.650")) /**/ +#define PRIVLIB "c:\\perl\\5.5.660\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.5.660")) /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -2639,7 +2692,7 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.5.650\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.5.660\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -2657,8 +2710,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\site\\5.5.650\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.5.650")) /**/ +#define SITELIB "c:\\perl\\site\\5.5.660\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.5.660")) /**/ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2713,19 +2766,35 @@ */ #define Uid_t uid_t /* UID type */ -/* USE_64_BITS: +/* USE_64_BIT_ALL: + * This variable conditionally defines the USE_64_BIT_ALL symbol, + * and indicates that 64-bit integer types should be used + * when available. The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_ALL. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_64_BIT_INT: * This symbol, if defined, indicates that 64-bit integers should * be used when available. If not defined, the native integers - * will be used (be they 32 or 64 bits). + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. */ -#ifndef USE_64_BITS -/*#define USE_64_BITS /**/ +#ifndef USE_64_BIT_INT +/*#define USE_64_BIT_INT /**/ #endif /* USE_LARGE_FILES: * This symbol, if defined, indicates that large file support - * should be used when available. The USE_64_BITS symbol will - * also be turned on if necessary. + * should be used when available. */ #ifndef USE_LARGE_FILES /*#define USE_LARGE_FILES /**/ @@ -2739,14 +2808,6 @@ /*#define USE_LONG_DOUBLE /**/ #endif -/* USE_LONG_LONG: - * This symbol, if defined, indicates that long longs should - * be used when available. - */ -#ifndef USE_LONG_LONG -/*#define USE_LONG_LONG /**/ -#endif - #ifndef USE_MORE_BITS /*#define USE_MORE_BITS /**/ #endif diff --git a/win32/config_H.vc b/win32/config_H.vc index 1cd5e65a60..6677bcc4ce 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -293,6 +293,12 @@ */ /*#define HAS_LSTAT /**/ +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise routine is + * available to hint about the expected access behavior. + */ +/*#define HAS_MADVISE /**/ + /* HAS_MBLEN: * This symbol, if defined, indicates that the mblen routine is available * to find the number of bytes in a multibye character. @@ -344,6 +350,12 @@ */ #define HAS_MKDIR /**/ +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + /* HAS_MKFIFO: * This symbol, if defined, indicates that the mkfifo routine is * available to create FIFOs. Otherwise, mknod should be able to @@ -352,6 +364,20 @@ */ /*#define HAS_MKFIFO /**/ +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * temporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to exclusively create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + /* HAS_MKTIME: * This symbol, if defined, indicates that the mktime routine is * available. @@ -1082,7 +1108,7 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "c:\\perl\\5.5.650\\lib\\MSWin32-x86" /**/ +#define ARCHLIB "c:\\perl\\5.5.660\\lib\\MSWin32-x86" /**/ /*#define ARCHLIB_EXP "" /**/ /* ARCHNAME: @@ -1113,8 +1139,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ -#define BIN_EXP "c:\\perl\\5.5.650\\bin\\MSWin32-x86" /**/ +#define BIN "c:\\perl\\5.5.660\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.5.660\\bin\\MSWin32-x86" /**/ /* PERL_BINCOMPAT_5005: * This symbol, if defined, indicates that Perl 5.006 should be @@ -1338,6 +1364,7 @@ * available to stat filesystems by file descriptors. */ /*#define HAS_FSTATFS /**/ + /* HAS_FTELLO: * This symbol, if defined, indicates that the ftello routine is * available to ftell beyond 32 bits (useful for ILP32 hosts). @@ -1361,6 +1388,18 @@ */ #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. + */ +/*#define HAS_GETCWD /**/ + +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems in bulk. + */ +/*#define HAS_GETFSSTAT /**/ + /* HAS_GETGRENT: * This symbol, if defined, indicates that the getgrent routine is * available for sequential access of the group database. @@ -1608,6 +1647,14 @@ #define LONGLONGSIZE 8 /**/ #endif +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek _((int, off_t, int)); + */ +#define HAS_LSEEK_PROTO /**/ + /* HAS_MEMCHR: * This symbol, if defined, indicates that the memchr routine is available * to locate characters within a C string. @@ -1836,6 +1883,12 @@ /*#define HAS_MSG_PROXY /**/ /*#define HAS_SCM_RIGHTS /**/ +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + /* HAS_SQRTL: * This symbol, if defined, indicates that the sqrtl routine is * available to do long double square roots. @@ -2540,8 +2593,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5.5.650\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.5.650")) /**/ +#define PRIVLIB "c:\\perl\\5.5.660\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.5.660")) /**/ /* PTRSIZE: * This symbol contains the size of a pointer, so that the C preprocessor @@ -2639,7 +2692,7 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.5.650\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.5.660\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -2657,8 +2710,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\site\\5.5.650\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.5.650")) /**/ +#define SITELIB "c:\\perl\\site\\5.5.660\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.5.660")) /**/ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2713,19 +2766,35 @@ */ #define Uid_t uid_t /* UID type */ -/* USE_64_BITS: +/* USE_64_BIT_ALL: + * This variable conditionally defines the USE_64_BIT_ALL symbol, + * and indicates that 64-bit integer types should be used + * when available. The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_INT. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_64_BIT_INT: * This symbol, if defined, indicates that 64-bit integers should * be used when available. If not defined, the native integers - * will be used (be they 32 or 64 bits). + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. */ -#ifndef USE_64_BITS -/*#define USE_64_BITS /**/ +#ifndef USE_64_BIT_INT +/*#define USE_64_BIT_INT /**/ #endif /* USE_LARGE_FILES: * This symbol, if defined, indicates that large file support - * should be used when available. The USE_64_BITS symbol will - * also be turned on if necessary. + * should be used when available. */ #ifndef USE_LARGE_FILES /*#define USE_LARGE_FILES /**/ @@ -2739,14 +2808,6 @@ /*#define USE_LONG_DOUBLE /**/ #endif -/* USE_LONG_LONG: - * This symbol, if defined, indicates that long longs should - * be used when available. - */ -#ifndef USE_LONG_LONG -/*#define USE_LONG_LONG /**/ -#endif - #ifndef USE_MORE_BITS /*#define USE_MORE_BITS /**/ #endif diff --git a/win32/makefile.mk b/win32/makefile.mk index 64f89fdbb3..6357300b18 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -33,7 +33,7 @@ INST_TOP *= $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -INST_VER *= \5.5.650 +INST_VER *= \5.5.660 # # Comment this out if you DON'T want your perl installation to have @@ -99,9 +99,9 @@ INST_ARCH *= \$(ARCHNAME) # Visual C++ >= 6.x #CCTYPE *= MSVC60 # Borland 5.02 or later -CCTYPE *= BORLAND -# mingw32/gcc-2.95.2 or better -#CCTYPE *= GCC +#CCTYPE *= BORLAND +# mingw32+gcc-2.95.2 or better +CCTYPE *= GCC # # uncomment this if you are compiling under Windows 95/98 and command.com @@ -165,9 +165,9 @@ CCTYPE *= BORLAND # so you may have to set CCHOME explicitly (spaces in the path name should # not be quoted) # -CCHOME *= c:\bc5 +#CCHOME *= c:\bc5 #CCHOME *= $(MSVCDIR) -#CCHOME *= D:\packages\mingw32 +CCHOME *= c:\gcc-2.95.2-msvcrt CCINCDIR *= $(CCHOME)\include CCLIBDIR *= $(CCHOME)\lib @@ -288,8 +288,8 @@ ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE) .ENDIF -.IF "$(USE_OBJECT)" == "define" -ARCHNAME = $(ARCHNAME)-thread +.IF "$(USE_ITHREADS)" == "define" +ARCHNAME !:= $(ARCHNAME)-thread .ENDIF # Visual Studio 98 specific @@ -409,6 +409,9 @@ OBJOUT_FLAG = -o EXEOUT_FLAG = -o LIBOUT_FLAG = +# NOTE: we assume that GCC uses MSVCRT.DLL +BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX + .ELSE CC = cl @@ -576,6 +579,7 @@ UTILS = \ ..\pod\podselect \ ..\x2p\find2perl \ ..\x2p\s2p \ + bin\exetype.pl \ bin\runperl.pl \ bin\pl2bat.pl \ bin\perlglob.pl \ @@ -590,11 +594,7 @@ CFGH_TMPL = config_H.bc CFGSH_TMPL = config.gc CFGH_TMPL = config_H.gc -.IF "$(USE_OBJECT)" == "define" -PERLIMPLIB = ..\libperlcore$(a) -.ELSE -PERLIMPLIB = ..\libperl$(a) -.ENDIF +PERLIMPLIB = ..\libperl56$(a) .ELSE @@ -741,7 +741,8 @@ SETARGV_OBJ = setargv$(o) .ENDIF DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \ - Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob + Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \ + Sys/Hostname STATIC_EXT = DynaLoader NONXS_EXT = Errno @@ -762,6 +763,7 @@ PEEK = $(EXTDIR)\Devel\Peek\Peek BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader DPROF = $(EXTDIR)\Devel\DProf\DProf GLOB = $(EXTDIR)\File\Glob\Glob +HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll @@ -778,6 +780,7 @@ RE_DLL = $(AUTODIR)\re\re.dll BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll +HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll ERRNO_PM = $(LIBDIR)\Errno.pm @@ -796,7 +799,8 @@ EXTENSION_C = \ $(B).c \ $(BYTELOADER).c \ $(DPROF).c \ - $(GLOB).c + $(GLOB).c \ + $(HOSTNAME).c EXTENSION_DLL = \ $(SOCKET_DLL) \ @@ -813,7 +817,8 @@ EXTENSION_DLL = \ $(THREAD_DLL) \ $(BYTELOADER_DLL) \ $(DPROF_DLL) \ - $(GLOB_DLL) + $(GLOB_DLL) \ + $(HOSTNAME_DLL) EXTENSION_PM = \ $(ERRNO_PM) @@ -1182,6 +1187,11 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl cd $(EXTDIR)\$(*B) && $(MAKE) +$(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs + cd $(EXTDIR)\Sys\$(*B) && \ + ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl + cd $(EXTDIR)\Sys\$(*B) && $(MAKE) + $(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs cd $(EXTDIR)\$(*B) && \ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl diff --git a/win32/perlhost.h b/win32/perlhost.h index 4b4ad586a4..a748ead0b2 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -486,6 +486,12 @@ PerlEnvSiteLibPath(struct IPerlEnv* piPerl, char *pl) return g_win32_get_sitelib(pl); } +void +PerlEnvGetChildIO(struct IPerlEnv* piPerl, child_IO_table* ptr) +{ + win32_get_child_IO(ptr); +} + struct IPerlEnv perlEnv = { PerlEnvGetenv, @@ -500,6 +506,7 @@ struct IPerlEnv perlEnv = PerlEnvOsId, PerlEnvLibPath, PerlEnvSiteLibPath, + PerlEnvGetChildIO, }; #undef IPERL2HOST diff --git a/win32/vdir.h b/win32/vdir.h index 50822a7aa4..df9a10b130 100644 --- a/win32/vdir.h +++ b/win32/vdir.h @@ -25,14 +25,6 @@ public: WCHAR* MapPathW(const WCHAR *pInName); int SetCurrentDirectoryA(char *lpBuffer); int SetCurrentDirectoryW(WCHAR *lpBuffer); - inline const char *GetDirA(int index) - { - return dirTableA[index]; - }; - inline const WCHAR *GetDirW(int index) - { - return dirTableW[index]; - }; inline int GetDefault(void) { return nDefault; }; inline char* GetCurrentDirectoryA(int dwBufSize, char *lpBuffer) @@ -84,6 +76,32 @@ protected: SetDirW(pPath, index); nDefault = index; }; + inline const char *GetDirA(int index) + { + char *ptr = dirTableA[index]; + if (!ptr) { + /* simulate the existance of this drive */ + ptr = szLocalBufferA; + ptr[0] = 'A' + index; + ptr[1] = ':'; + ptr[2] = '\\'; + ptr[3] = 0; + } + return ptr; + }; + inline const WCHAR *GetDirW(int index) + { + WCHAR *ptr = dirTableW[index]; + if (!ptr) { + /* simulate the existance of this drive */ + ptr = szLocalBufferW; + ptr[0] = 'A' + index; + ptr[1] = ':'; + ptr[2] = '\\'; + ptr[3] = 0; + } + return ptr; + }; inline int DriveIndex(char chr) { @@ -265,6 +283,82 @@ inline void DoGetFullPathNameA(char* lpBuffer, DWORD dwSize, char* Dest) GetFullPathNameA(lpBuffer, dwSize, Dest, &pPtr); } +inline bool IsSpecialFileName(const char* pName) +{ + /* specical file names are devices that the system can open + * these include AUX, CON, NUL, PRN, COMx, LPTx, CLOCK$, CONIN$, CONOUT$ + * (x is a single digit, and names are case-insensitive) + */ + char ch = (pName[0] & ~0x20); + switch (ch) + { + case 'A': /* AUX */ + if (((pName[1] & ~0x20) == 'U') + && ((pName[2] & ~0x20) == 'X') + && !pName[3]) + return true; + break; + case 'C': /* CLOCK$, COMx, CON, CONIN$ CONOUT$ */ + ch = (pName[1] & ~0x20); + switch (ch) + { + case 'L': /* CLOCK$ */ + if (((pName[2] & ~0x20) == 'O') + && ((pName[3] & ~0x20) == 'C') + && ((pName[4] & ~0x20) == 'K') + && (pName[5] == '$') + && !pName[6]) + return true; + break; + case 'O': /* COMx, CON, CONIN$ CONOUT$ */ + if ((pName[2] & ~0x20) == 'M') { + if ((pName[3] >= '1') && (pName[3] <= '9') + && !pName[4]) + return true; + } + else if ((pName[2] & ~0x20) == 'N') { + if (!pName[3]) + return true; + else if ((pName[3] & ~0x20) == 'I') { + if (((pName[4] & ~0x20) == 'N') + && (pName[5] == '$') + && !pName[6]) + return true; + } + else if ((pName[3] & ~0x20) == 'O') { + if (((pName[4] & ~0x20) == 'U') + && ((pName[5] & ~0x20) == 'T') + && (pName[6] == '$') + && !pName[7]) + return true; + } + } + break; + } + break; + case 'L': /* LPTx */ + if (((pName[1] & ~0x20) == 'U') + && ((pName[2] & ~0x20) == 'X') + && (pName[3] >= '1') && (pName[3] <= '9') + && !pName[4]) + return true; + break; + case 'N': /* NUL */ + if (((pName[1] & ~0x20) == 'U') + && ((pName[2] & ~0x20) == 'L') + && !pName[3]) + return true; + break; + case 'P': /* PRN */ + if (((pName[1] & ~0x20) == 'R') + && ((pName[2] & ~0x20) == 'N') + && !pName[3]) + return true; + break; + } + return false; +} + char *VDir::MapPathA(const char *pInName) { /* * possiblities -- relative path or absolute path with or without drive letter @@ -317,11 +411,16 @@ char *VDir::MapPathA(const char *pInName) } else { /* relative path */ - strcat(szBuffer, pInName); - if (strlen(szBuffer) > MAX_PATH) - szBuffer[MAX_PATH] = '\0'; + if (IsSpecialFileName(pInName)) { + return (char*)pInName; + } + else { + strcat(szBuffer, pInName); + if (strlen(szBuffer) > MAX_PATH) + szBuffer[MAX_PATH] = '\0'; - DoGetFullPathNameA(szBuffer, sizeof(szLocalBufferA), szLocalBufferA); + DoGetFullPathNameA(szBuffer, sizeof(szLocalBufferA), szLocalBufferA); + } } } } @@ -408,6 +507,82 @@ inline void DoGetFullPathNameW(WCHAR* lpBuffer, DWORD dwSize, WCHAR* Dest) GetFullPathNameW(lpBuffer, dwSize, Dest, &pPtr); } +inline bool IsSpecialFileName(const WCHAR* pName) +{ + /* specical file names are devices that the system can open + * these include AUX, CON, NUL, PRN, COMx, LPTx, CLOCK$, CONIN$, CONOUT$ + * (x is a single digit, and names are case-insensitive) + */ + WCHAR ch = (pName[0] & ~0x20); + switch (ch) + { + case 'A': /* AUX */ + if (((pName[1] & ~0x20) == 'U') + && ((pName[2] & ~0x20) == 'X') + && !pName[3]) + return true; + break; + case 'C': /* CLOCK$, COMx, CON, CONIN$ CONOUT$ */ + ch = (pName[1] & ~0x20); + switch (ch) + { + case 'L': /* CLOCK$ */ + if (((pName[2] & ~0x20) == 'O') + && ((pName[3] & ~0x20) == 'C') + && ((pName[4] & ~0x20) == 'K') + && (pName[5] == '$') + && !pName[6]) + return true; + break; + case 'O': /* COMx, CON, CONIN$ CONOUT$ */ + if ((pName[2] & ~0x20) == 'M') { + if ((pName[3] >= '1') && (pName[3] <= '9') + && !pName[4]) + return true; + } + else if ((pName[2] & ~0x20) == 'N') { + if (!pName[3]) + return true; + else if ((pName[3] & ~0x20) == 'I') { + if (((pName[4] & ~0x20) == 'N') + && (pName[5] == '$') + && !pName[6]) + return true; + } + else if ((pName[3] & ~0x20) == 'O') { + if (((pName[4] & ~0x20) == 'U') + && ((pName[5] & ~0x20) == 'T') + && (pName[6] == '$') + && !pName[7]) + return true; + } + } + break; + } + break; + case 'L': /* LPTx */ + if (((pName[1] & ~0x20) == 'U') + && ((pName[2] & ~0x20) == 'X') + && (pName[3] >= '1') && (pName[3] <= '9') + && !pName[4]) + return true; + break; + case 'N': /* NUL */ + if (((pName[1] & ~0x20) == 'U') + && ((pName[2] & ~0x20) == 'L') + && !pName[3]) + return true; + break; + case 'P': /* PRN */ + if (((pName[1] & ~0x20) == 'R') + && ((pName[2] & ~0x20) == 'N') + && !pName[3]) + return true; + break; + } + return false; +} + WCHAR* VDir::MapPathW(const WCHAR *pInName) { /* * possiblities -- relative path or absolute path with or without drive letter @@ -460,11 +635,16 @@ WCHAR* VDir::MapPathW(const WCHAR *pInName) } else { /* relative path */ - wcscat(szBuffer, pInName); - if (wcslen(szBuffer) > MAX_PATH) - szBuffer[MAX_PATH] = '\0'; + if (IsSpecialFileName(pInName)) { + return (WCHAR*)pInName; + } + else { + wcscat(szBuffer, pInName); + if (wcslen(szBuffer) > MAX_PATH) + szBuffer[MAX_PATH] = '\0'; - DoGetFullPathNameW(szBuffer, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW); + DoGetFullPathNameW(szBuffer, (sizeof(szLocalBufferW)/sizeof(WCHAR)), szLocalBufferW); + } } } } diff --git a/win32/win32.c b/win32/win32.c index 71097ea1ae..ff52692fec 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1132,6 +1132,7 @@ win32_stat(const char *path, struct stat *sbuf) if (S_ISDIR(sbuf->st_mode)) sbuf->st_mode |= S_IWRITE | S_IEXEC; else if (S_ISREG(sbuf->st_mode)) { + int perms; if (l >= 4 && path[l-4] == '.') { const char *e = path + l - 3; if (strnicmp(e,"exe",3) @@ -1144,6 +1145,9 @@ win32_stat(const char *path, struct stat *sbuf) } else sbuf->st_mode &= ~S_IEXEC; + /* Propagate permissions to _group_ and _others_ */ + perms = sbuf->st_mode & (S_IREAD|S_IWRITE|S_IEXEC); + sbuf->st_mode |= (perms>>3) | (perms>>6); } #endif } @@ -2709,7 +2713,12 @@ _fixed_read(int fh, void *buf, unsigned cnt) return -1; } - EnterCriticalSection(&(_pioinfo(fh)->lock)); /* lock file */ + /* + * If lockinitflag is FALSE, assume fd is device + * lockinitflag is set to TRUE by open. + */ + if (_pioinfo(fh)->lockinitflag) + EnterCriticalSection(&(_pioinfo(fh)->lock)); /* lock file */ bytes_read = 0; /* nothing read yet */ buffer = (char*)buf; @@ -2857,7 +2866,8 @@ _fixed_read(int fh, void *buf, unsigned cnt) } functionexit: - LeaveCriticalSection(&(_pioinfo(fh)->lock)); /* unlock file */ + if (_pioinfo(fh)->lockinitflag) + LeaveCriticalSection(&(_pioinfo(fh)->lock)); /* unlock file */ return bytes_read; } @@ -3119,6 +3129,7 @@ win32_spawnvp(int mode, const char *cmdname, const char *const *argv) int ret; void* env; char* dir; + child_IO_table tbl; STARTUPINFO StartupInfo; PROCESS_INFORMATION ProcessInformation; DWORD create = 0; @@ -3147,9 +3158,10 @@ win32_spawnvp(int mode, const char *cmdname, const char *const *argv) } memset(&StartupInfo,0,sizeof(StartupInfo)); StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - StartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE); + PerlEnv_get_child_IO(&tbl); + StartupInfo.hStdInput = tbl.childStdIn; + StartupInfo.hStdOutput = tbl.childStdOut; + StartupInfo.hStdError = tbl.childStdErr; if (StartupInfo.hStdInput != INVALID_HANDLE_VALUE && StartupInfo.hStdOutput != INVALID_HANDLE_VALUE && StartupInfo.hStdError != INVALID_HANDLE_VALUE) @@ -3960,6 +3972,15 @@ Perl_win32_init(int *argcp, char ***argvp) MALLOC_INIT; } +void +win32_get_child_IO(child_IO_table* ptbl) +{ + ptbl->childStdIn = GetStdHandle(STD_INPUT_HANDLE); + ptbl->childStdOut = GetStdHandle(STD_OUTPUT_HANDLE); + ptbl->childStdErr = GetStdHandle(STD_ERROR_HANDLE); +} + + #ifdef USE_ITHREADS # ifdef PERL_OBJECT diff --git a/win32/win32.h b/win32/win32.h index 65d24e4c65..4e73a23fe6 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -75,6 +75,7 @@ #include <stdio.h> #include <direct.h> #include <stdlib.h> +#include <fcntl.h> #ifndef EXT #include "EXTERN.h" #endif @@ -300,6 +301,14 @@ DllExport int RunPerl(int argc, char **argv, char **env); DllExport bool SetPerlInterpreter(void* interp); DllExport void* GetPerlInterpreter(void); +typedef struct { + HANDLE childStdIn; + HANDLE childStdOut; + HANDLE childStdErr; +} child_IO_table; + +DllExport void win32_get_child_IO(child_IO_table* ptr); + #ifndef USE_SOCKETS_AS_HANDLES extern FILE * my_fdopen(int, char *); #endif |