| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
long is only 32-bits on x64 Win32, but time_t is 64-bits. This was warning:
POSIX.xs(1777) : warning C4244: 'initializing' : conversion from 'time_t' to 'const long', possible loss of data
The check against (time_t)-1 is the approved check from ANSI C 89 and
99.
|
|
|
|
|
|
|
|
|
|
| |
Microsoft, in their wisdom, chose to ignore the POSIX spec when implementing
their dup2(), and have theirs return 0 on success, instead of the file
descriptor. It seems that no other vendor is this, um, "special", so code
the exception directly, as we don't run Configure on Win32, so there's little
point probing for this.
This resolves RT #98912.
|
|
|
|
|
|
|
|
| |
Previously it was a Perl wrapper for CORE::sleep, converting CORE::sleep's
return value of elapsed time slept into the POSIX return value of seconds
remaining. However, that approach could sometimes return a negative result
if CORE::sleep had slept for more than a second longer than the requested
time.
|
|
|
|
|
|
|
|
|
|
| |
The whole point of sigsuspend and pause is to wait until a signal has
arrived, and then return *after* it has been triggered. Currently
delayed/"safe" signals prevent that from happening, which might cause
race conditions.
This patch prevents that (as far as possible) by running the signal
handlers ASAP.
|
|
|
|
|
|
|
|
|
| |
On Win32 which has no native TCSANOW definition this would produce:
Constant subroutine TCSANOW redefined at ../lib/POSIX.pm line -1.
because the macro wasn't defined when building the unknown symbols
table but was defined when building the defined symbols table.
|
|
|
|
|
|
|
|
| |
0 isn't valid on all operating systems. TCASNOW has the value 0 on most
operating systems, but on Solaris (at least) TCASNOW, TCSADRAIN and
TCSAFLUSH have the same values as the equivalent ioctls, TCSETS, TCSETSW and
TCSETSF. Solaris faults 0, setting errno to EINVAL. This isn't useful as a
default behaviour.
|
|
|
|
|
|
| |
As POSIX.xs is not dual life, we can always rely on these macros being
defined for us in perl.h. (And these days, dual life XS code should let
Devel::PPPort take care of this sort of thing.)
|
|
|
|
|
|
| |
This shares identical code marshaling 6 to 9 input arguments into a
struct tm. However, as the return types differ we have to explicitly code
pushing the return value onto perl's stack.
|
| |
|
|
|
|
| |
On this platform, this reduces the shared object size by about .5K.
|
|
|
|
|
|
|
| |
is{alnum,alpha,cntrl,digit,graph,lower,print,punct,space,upper,xdigit}
have identical structures, so replace them with one body to marshal
arguments between Perl and C, calling the C library is*() function via
a function pointer stored in the CV's XSANY.
|
|
|
|
|
|
| |
10 functions take a single NV argument and return an NV result. Merging them
reduces the shared object size by over 2K on this platform. (Argument
marshalling code in XS is not free.)
|
|
|
|
|
|
| |
This removes a lot of copy-paste code.
[with a tweak by Ilmari that removed residual duplication]
|
|
|
|
|
|
| |
Using ALIAS to merge POSIX::sig{pending,suspend} and
POSIX::tc{flow,flush,sendbreak} reduces the size of POSIX.so by about 2K
on this platform.
|
|
|
|
|
|
| |
Using ALIAS to merge cfget[io]speed(), get[cloi]flag(), cfset[io]speed()
and set[cloi]flag() reduces the size of POSIX.so by almost 2K on this
platform.
|
|
|
|
|
|
| |
Using ALIAS to merge addset() with delset() and emptyset() with fillset()
reduces the shared object size, by removing duplicate marshaling code for
arguments and return values. On this platform the saving is over .5K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously POSIX::SigSet was using the PTROBJ typemap to store a pointer to
a dynamically-allocated sigset_t as an IV (blessed into the class)
This requires an explicit DESTROY to free the dynamic allocation, but fails
badly if any POSIX::SigSet objects exist at ithread clone time, as the
dynamic allocation is not duplicated in the new thread. (DESTROY is called
in both threads, free-from-wrong pool or other jollity occurs.)
Removing dynamic allocation removes the need for a DESTROY method.
This change is analogous to the previous change in POSIX::Termios, and is
made for the same reason.
|
|
|
|
|
| |
The same code will be needed for POSIX::SigSet::new(), so share it as a small
static function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously POSIX::Termios was using the PTROBJ typemap to store a pointer to
a dynamically-allocated struct termios as an IV (blessed into the class).
This requires an explicit DESTROY to free the dynamic allocation, but fails
badly if any POSIX::Termios objects exist at ithread clone time, as the
dynamic allocation is not duplicated in the new thread. (DESTROY is called
in both threads, free-from-wrong pool or other jollity occurs.)
Removing dynamic allocation removes the need for a DESTROY method.
This introduces a new OPAQUEPTROBJ typemap, but currently doesn't use the
OUTPUT section, as that copies an existing structure, whereas
POSIX::Termios->new() only needs to zero-allocate the right space. Assuming
that this typemap should be of general applicability, it should be moved to
the main typemap file.
|
|
|
|
|
| |
Remove support for the Borland C++ compiler on Win32, as agreed here:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00034.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Perl traditionally stores WinSock error codes (values above 10000) in
errno, with corresponding support for $! to stringify them properly.
In Visual Studio 2010 (and presumably newer Windows SDKs) Microsoft
has started to define additional errno constants in errno.h (values
between 100 and 200) with conflicting names (e.g. EWOULDBLOCK).
There are 2 ways to deal with this situation:
1) Redefine the errno.h constants back to the winsock values for
the Errno and POSIX modules.
2) Translate the winsock error codes to the new errno constants
in the socket implementation in win32/win32sck.c.
Solution 1) has the advantage that any existing Perl code that has
numeric error codes hard-coded in it will continue to work.
Solution 2) has the advantage that XS code using external libaries can
set errno to the new constants, and they will be handled consistently
in the Perl core. It will however need additional support for other
compilers and runtime libraries that don't support these new error
codes.
This commit implements solution 1).
Blame attribution: the commit message is from Jan Dubois,
the actual patch was created by Steve Hay.
Signed-off-by: Jan Dubois <jand@activestate.com>
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81882]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81882 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
|
|
|
|
|
|
| |
Trivial changes to fix warnings of types
* unclear precedence
* assignment as conditional
* signed/unsigned mixing
* unused parameter/variable
* value computed not used
* wrong argument type for a printf format
* variable may be used uninitialised (due to unhandled switch case)
|
| |
|
|
|
|
|
|
|
|
| |
There is the assignment "RETVAL = 0" to silence the compiler in case
it incorrectly reports return of an undefined value.
This assignment should be present whenever *any* of the symbols is
not defined. But the code was written so that the assignment was
compiled only when *none* of the symbols was defined.
|
| |
|
| |
|
| |
|
|
|
|
| |
Brought to you by the Campaign for the Elimination of strlen().
|
| |
|
|
|
|
|
|
|
|
| |
string.
(Restore the intent of 9e8c01f558a03902ff2f54935fd7e6dcc7ec656c, but with non-
buggy tests. Improve the implementation so that it doesn't always upgrade the
format string to UTF-8.)
|
|
|
|
|
|
| |
others.
This reverts commit 9e8c01f558a03902ff2f54935fd7e6dcc7ec656c.
|
|
|
|
| |
format string the same as ASCII ones.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The attached patch fixes a compilation warning from POSIX.xs when cuserid
is missing and ints and pointers have different size. eg on Mac OSX when
using 64-bit mode.
gcc-4.2 -c -fno-common -DPERL_DARWIN -no-cpp-precomp -arch x86_64 -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -I/opt/local/include -O3 -g -DVERSION=\"1.17\"
-DXS_VERSION=\"1.17\" "-I../.." POSIX.c
POSIX.c: In function 'XS_POSIX_cuserid':
POSIX.c:4096: warning: cast to pointer from integer of different size
Running Mkbootstrap for POSIX ()
chmod 644 POSIX.bs
rm -f ../../lib/auto/POSIX/POSIX.bundle
Also relevant for 5.10.1.
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
|
|
|
|
|
|
|
| |
Jan Dubois suggested POSIX::tzset() should be fixed too, but there is no
way to share the code since Time-Piece is dual-lived and POSIX is not.
Therefore, the code is simply duplicated with appropriate comments to
prompt keeping the two in sync.
|
|
|
|
|
|
|
|
| |
(MacOS support was removed from MakeMaker in 6.22, and merged to blead on
15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this
point MacOS wouldn't even have been able to build the perl binary, because it
would not have been able to build DynaLoader. If anyone wishes to resurrect
MacOS, start by reversing this commit and the relevant part of that commit.)
|
|
|
|
|
|
|
|
|
| |
Message-Id: <20081029022544.413.1@knochen-vm.localdomain>
I re-introduced the use of the WMUNGE() macro, which was
(accidentally?) removed after 5.10.0. The macro is still a hack. As my
added comment explains the use of the OS's W*() macros in this context
is simply not correct and should probably better be fixed.
|
|
|
|
|
| |
(There was never an error, as croak() was called before the return).
p4raw-id: //depot/perl@33956
|
|
|
|
|
|
|
| |
be defined. This fix changes the error message from "Your vendor has
not defined POSIX macro %s, used" to "POSIX::%s not implemented on
this architecture", which I assume is not going to break anything.
p4raw-id: //depot/perl@33936
|
|
|
|
|
|
|
|
| |
and WTERMSIG wrappers with one wrapper using the XS "ALIAS" feature.
This gets the shared object size back below the size before the removal
of int_macro_int. It looks like there are other space savings to be
made this way.
p4raw-id: //depot/perl@33897
|
|
|
|
|
|
|
|
| |
that creates closures round it. Instead, wrap WEXITSTATUS, WIFEXITED,
WIFSIGNALED, WIFSTOPPED, WSTOPSIG and WTERMSIG directly with XS.
The shared library is slightly larger, but dynamic memory usage savings
beat this, even within one thread of one process. Simpler code too.
p4raw-id: //depot/perl@33896
|
|
|
|
|
|
|
| |
S_ISFIFO and S_ISREG, and pull them in from Fcntl. Spotted as a result
of bug #54186, but there has been a redefined subroutine warning for
ages if you elected to import all of POSIX and Fcntl's exports.
p4raw-id: //depot/perl@33826
|
|
|
|
|
|
|
| |
Message-ID: <46A0F33545E63740BC7563DE59CA9C6D0939C3@exchsvr2.npl.ad.local>
More consting.
p4raw-id: //depot/perl@32947
|
|
|
|
|
|
|
| |
From: "Robin Barker" <Robin.Barker@npl.co.uk>
Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399D@exchsvr2.npl.ad.local>
Date: Sat, 22 Dec 2007 00:39:47 -0000
p4raw-id: //depot/perl@32703
|
|
|
|
|
|
|
|
| |
buffer that may be overwritten by subsequent calls to the CRT
function, so we must make a safe copy of that buffer for our own
use. This fixes lib/locale.t on Win32 with the Borland compiler,
but presumably could affect other compilers too.
p4raw-id: //depot/perl@31482
|
|
|
| |
p4raw-id: //depot/perl@30898
|
|
|
|
|
| |
instead of 0, as suggested by Mike Schilli.
p4raw-id: //depot/perl@30590
|
|
|
| |
p4raw-id: //depot/perl@29408
|
|
|
|
|
| |
of Perl.
p4raw-id: //depot/perl@28729
|
|
|
| |
p4raw-id: //depot/perl@28142
|