summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Chris Herborth <chrish@pobox.com>:Fred Drake2000-08-151-5/+0
| | | | | | | | | Minor updates for BeOS R5. Use of OSError in test.test_fork1 changed to TestSkipped, with corresponding change in BeOS/README (by Fred). This closes SourceForge patch #100978.
* Fix for bug #110670 - Win32 os.listdir raises confusing errors:Mark Hammond2000-08-151-3/+7
| | | | The existing win32_error() function now returns the new(ish) WindowsError, ensuring we get correct error messages.
* Patch #101032, from David Bolen:Mark Hammond2000-08-141-48/+154
| | | | | This is an enhancement to a prior patch (100941) ... [T]his patch removes the risk of deadlock waiting for the child previously present in certain cases. It adds tracking of all file handles returned from an os.popen* call and only waits for the child process, returning the exit code, on the closure of the final file handle to that child.
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-2/+0
| | | | marked my*.h as obsolete
* - changed windows pclose to make sure we don't return before theFredrik Lundh2000-07-261-10/+21
| | | | | underlying process has terminated (bug fix from David Bolen)
* Create a new section of pyport.h to hold all external function declarationsThomas Wouters2000-07-241-20/+2
| | | | | | | | | | | | | | for systems that are missing those declarations from system include files. Start by moving a pointy-haired ones from their previous locations to the new section. (The gethostname() one, for instance, breaks on several systems, because some define it as (char *, size_t) and some as (char *, int).) I purposely decided not to include the summary of used #defines like Tim did in the first section of pyport.h. In my opinion, the number of #defines likedly to be used by this section would make such an overview unwieldy. I would suggest documenting the non-obvious ones, though.
* -- added code to the new Windows popen functions to make closeFredrik Lundh2000-07-231-8/+90
| | | | | | return the exit code. Only works on Windows NT/2000, due to limitations in the Win9X shell. (based on patch #100941 by David Bolen)
* Even more ANSIfication: fix as many function pointers and declarations asThomas Wouters2000-07-221-5/+5
| | | | possible.
* Remove unused helper-function 'posix_strint'.Thomas Wouters2000-07-221-18/+0
|
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-9/+6
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* ANSIfy the just-checked-in isatty() wrapper.Thomas Wouters2000-07-191-3/+1
|
* new method isatty from Thomas WoutersSkip Montanaro2000-07-191-0/+16
|
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-4/+4
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* Move (actually copy) support for the sgi._getpty() function intoThomas Wouters2000-07-141-5/+24
| | | | | | | posix.openpty(). And conveniently also check if CVS write access really works. Closes SF patch #100722
* From Sam Rushing's Medusa, via SF patch #100858: add & documentAndrew M. Kuchling2000-07-131-0/+88
| | | | os.seteuid(), os.setegid(), os.setreuid(), os.setregid().
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-121-2/+2
|
* - stupid typo.Fredrik Lundh2000-07-101-1/+1
|
* -- get rid of a compiler warning on unix. (as reportedFredrik Lundh2000-07-101-21/+13
| | | | for #100836, but implemented in a different way)
* - changed the nt.popen2 return values back toFredrik Lundh2000-07-091-30/+30
| | | | | | | | (write, read, ...), based on feedback from GvR. - added tuple-swapping code to popen2.py - fixed some runaway indentation in posixmodule.c
* - added popen.popen2/popen3/popen4 support forFredrik Lundh2000-07-091-7/+7
| | | | | | | | | | | | windows. - added optional mode argument to popen2/popen3 for unix; if the second argument is an integer, it's assumed to be the buffer size. - changed nt.popen2/popen3/popen4 return values to match the popen2 module (stdout first, not stdin).
* - added optional bufsize argument to new popen methods.Fredrik Lundh2000-07-091-7/+30
| | | | | for the moment, this argument must be left out or set to -1 (only the default bufsize is supported, that is)
* - improved os.popen support for windows, based on win32pipeFredrik Lundh2000-07-091-6/+462
| | | | | | | by Bill Tutt. note: to run this on Windows 95/98, you need to have the w9xpopen.exe helper in the same directory as the python DLL.
* - fixed pointer size test in spawn functions. also addedFredrik Lundh2000-07-091-6/+6
| | | | | | | cast to make sure Py_BuildValue gets the right thing. this change eliminates bogus return codes from successful spawn calls (e.g. 2167387144924954624 instead of 0).
* this one's a bit risky, but I've spent some considerable timeFredrik Lundh2000-07-081-340/+132
| | | | | | | | | | staring at the diffs before checking this one in. let me know asap if it breaks things on your platform. -- ANSI-fying (patch #100763 by Peter Schneider-Kamp, minus the indentation changes and minus the changes the broke the windows build)
* Fix bug #392, reported by Jonathan Giddy <jon@dstc.edu.au>:Fred Drake2000-07-061-2/+4
| | | | | | | | | | | | In posixmodule.c:posix_fork, the function PyOS_AfterFork is called for both the parent and the child, despite the docs stating that it should be called in the new (child) process. This causes problems in the parent since the forking thread becomes the main thread according to the signal module. Calling PyOS_AfterFork() only in the child fixes this. Changed for both fork() and forkpty().
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Crude way to fix a problem on AIX: #undef STAT before defining it.Guido van Rossum2000-06-301-0/+1
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-291-67/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the posix module for large file support mainly on Win64, although some general cleanup is done as well. The changes are: - abstract stat->STAT, fstat->FSTAT, and struct stat->STRUCT_STAT This is because stat() etc. are not the correct functions to use on Win64 (nor maybe on other platforms?, if not then it is now trivial to select the appropriate one). On Win64 the appropriate system functions are _stati64(), etc. - add _pystat_fromstructstat(), it builds the return tuple for the fstat system call. This functionality was being duplicated. As well the construction of the tuple was modified to ensure no overflow of the time_t elements (sizeof(time_t) > sizeof(long) on Win64). - add overflow protection for the return values of posix_spawnv and posix_spawnve - use the proper 64-bit capable lseek() on Win64 - use intptr_t instead of long where appropriate from Win32/64 blocks (sizeof(void*) > sizeof(long) on Win64) This closes SourceForge patch #100513.
* Thomas Wouters <thomas@xs4all.net>:Fred Drake2000-06-281-0/+64
| | | | | | | | | | | | | This patch adds the openpty() and forkpty() library calls to posixmodule.c, when they are available on the target system. (glibc-2.1-based Linux systems, FreeBSD and BSDI at least, probably the other BSD-based systems as well.) Lib/pty.py is also rewritten to use openpty when available, but falls back to the old SGI method or the "manual" BSD open-a-pty code. Openpty() is necessary to use the Unix98 ptys under Linux 2.2, or when using non-standard tty names under (at least) BSDI, which is why I needed it, myself ;-) forkpty() is included for symmetry.
* Patch from Trent Mick:Andrew M. Kuchling2000-06-061-1/+1
| | | | | Fix a small bug in posixmodule.c where a char* is being dereferenced where it should not be.
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2000-06-011-3/+4
| | | | | Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
* Mark Hammond to the rescue:Guido van Rossum2000-05-031-3/+4
| | | | | | | | | | | | Checkin 2.131 of posixmodule.c changed os.stat on Windows, so that "/bin/" type notation (trailing backslash) would work on Windows to be consistent with Unix. However, the patch broke the simple case of: os.stat("\\") This did work in 1.5.2, and obviously should! This patch addresses this, and restores the correct behaviour.
* posix_utime(): Allow the second argument to be None, which invokes theBarry Warsaw2000-05-011-7/+23
| | | | | | utime(path, NULL) call, setting the atime and mtime of the file to the current time. The previous signature utime(path, (atime, mtime)) is of course still allowed.
* Michael Hudson:Guido van Rossum2000-04-261-3/+16
| | | | | | | | | | | | This patch changes posixmodule.c:execv to a) check for zero length args (does this to execve, too), raising ValueError. b) raises more rational exceptions for various flavours of duff arguments. I *hate* TypeError: "illegal argument type for built-in operation" It has to be one of the most frustrating error messages ever.
* Patch by Brian Hooper, somewhat augmented by GvR, to strip a trailingGuido van Rossum2000-04-211-0/+28
| | | | | | | | | | backslash from the pathname argument to stat() on Windows -- while on Unix, stat("/bin/") succeeds and does the same thing as stat("/bin"), on Windows, stat("\\windows\\") fails while stat("\\windows") succeeds. This modified version of the patch recognizes both / and \. (This is odd behavior of the MS C library, since os.listdir("\\windows\\") succeeds!)
* setup_confname_table(): Close memory leak caused by not decref'ing theBarry Warsaw2000-04-131-16/+15
| | | | inserted dictionary values. Also, simplified the logic a bit.
* Sigh. On Windows, (mode_t)i fails. Assume that there's a prototypeGuido van Rossum2000-03-311-1/+1
| | | | in scope on systems where mode_t isn't the same size as int...
* Oops, the previous patch contained a bug in chmod. Fixed now.Guido van Rossum2000-03-311-2/+2
|
* Two robustness patches:Guido van Rossum2000-03-311-5/+12
| | | | | | | | | (1) In opendir(), don't call the lock-release macros; we're manipulating list objects and that shouldn't be done in unlocked state. (2) Don't use posix_strint() for chmod() -- the mode_t arg might be a 64 bit int (reported by Nick Maclaren).
* Second attempt to fix the ctermid_r/tmpnam_r warnings: define USE_CTERMID_RGreg Ward2000-03-011-3/+13
| | | | | and USE_TMPNAM_R at the top of the file and refer to them later; this catches a second reference to 'tmpnam_r' that I didn't spot first time around.
* Fix compiler warning: only use "_r" form of 'ctermid()' and 'tmpnam()' whenGreg Ward2000-03-011-2/+2
| | | | building a threaded Python.
* Delete references to _SC_AIO_LIST_MAX; it appears that that symbol wasGuido van Rossum2000-02-251-3/+0
| | | | | just a typo in some Linux header; the real symbol is _SC_AIO_LISTIO_MAX.
* The initialization of posix_putenv_garbage should only be done when itGuido van Rossum2000-01-311-0/+2
| | | | is defined...
* setup_confname_table(): Use size_t instead of int for an index whenFred Drake1999-12-301-1/+1
| | | | | | | building the dicts used to inform the user about the defined constants when using the *conf*() APIs. Thanks to Mark Hammond <mhammond@skippinet.com.au>.
* Rip out the code to check the ordering of the tables used to mapFred Drake1999-12-151-31/+65
| | | | | | | | | | | | strings to integers for the *conf*() functions. Added code to sort the tables at module initialization. Three dictionaries, confstr_names, sysconf_names, and pathconf_names, are added to the module as well. These map known configuration setting names to the numeric value which is used to represent the setting in the system call. This code is always called. Updated related comments.
* Added table entries for Irix 6.5 names for confstr()/sysconf()/Fred Drake1999-12-151-0/+174
| | | | | | | | pathconf() names, from Sjoerd. Added code to verify that these tables are properly ordered, only included and used when CHECK_CONFNAME_TABLES is defined. This is only needed to test the tables, so I haven't enabled this by default.
* Added support for getlogin(); does *not* use getlogin_r() whereFred Drake1999-12-141-44/+73
| | | | | | | | | | | | | | | available since the interface is poorly defined on at least one major platform (Solaris). Moved table of constant names for fpathconf() & pathconf() into the conditional that defines the conv_path_confname() helper; Mark Hammond reported that defining the table when none of the constants were defined causes the compiler to complain (won't allow 0-length array, imagine that!). In posix_fpathconf(), use conv_path_confname() as the O& conversion function, instead of the conv_confname() helper, which has the wrong signature (posix_pathconf() already used the right thing).
* Removed debugging prints.Fred Drake1999-12-131-4/+0
|
* Added bindings for getgroups(), fpathconf(), pathconf(), confstr(),Fred Drake1999-12-131-1/+863
| | | | | | | and sysconf(). *Lots* of tables to define names used by *conf*(); explanation to go in message to python-dev list.