summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Added support for abort(), ctermid(), tmpfile(), tempnam(), tmpnam(),Fred Drake1999-12-091-163/+326
| | | | | | | | | and TMP_MAX. Converted all functions that used PyArg_Parse() or PyArg_NoArgs() to use PyArg_ParseTuple() and specified all function names using the :name syntax in the format strings, to allow better error messages when TypeError is raised for parameter type mismatches.
* John DuBois tells us that SCO OpenServer 5.0 and later requires _SVID3Guido van Rossum1999-10-191-0/+5
| | | | before it reveals the needed definitions in sys/statvfs.h.
* posix_putenv(): Constrain memory leakage when setting the sameFred Drake1999-08-261-3/+24
| | | | | | environment variable repeatedly. I posted this to the list some time ago, but only now got around to asking g--d- what he thought about it.
* It turns out that modifying the environment strings is not safe.Guido van Rossum1999-08-031-6/+16
| | | | | | Treat them as read-only, and make a copy as appropriately. This was first reported by Bill Janssend and later by Craig Rowland and Ron Sedlmeyer. This fix is mine.
* Milton L. Hankin reports that on Windows it is possible to have twoGuido van Rossum1999-07-021-1/+2
| | | | | | | | different values in the environ dict with the same key (although he couldn't explain exactly how this came to be). Since getenv() uses the first one, Python should do too. (Some doubts about case sensitivity, but for now this at least seems the right thing to do regardless of platform.)
* posix_listdir(): When an error occurs, callBarry Warsaw1999-05-271-5/+5
| | | | | | posix_error_with_filename() instead of posix_error(), passing in the name argument, so you get information on which directory was being listed.
* Add extern decl for fsync() for SunOS 4.x.Guido van Rossum1999-04-071-0/+1
|
* # Typo in docstring (Retrun -> Return).Guido van Rossum1999-02-231-1/+1
|
* The docstring for ttyname(..) claims a second "mode" argument. TheGuido van Rossum1999-02-221-1/+1
| | | | actual code does not allow such an argument. (Finn Bock.)
* The symbols P_* (for spawn*(), MS specific) should not have a leadingGuido van Rossum1999-02-161-5/+5
| | | | underscore after all, for consistency with the O_* symnbols.
* Fixed totally bogus conversion factors used in the Win32 version ofGuido van Rossum1999-02-161-3/+10
| | | | os.times().
* Got rid of the file-global PosixError. This was redundant since itBarry Warsaw1999-02-091-8/+4
| | | | | | was just an alias for PyExc_OSError and the way we were doing it was causing a (small) memory leak anyway. Just use PyExc_OSError everywhere.
* Portability fix for [f]statvfs() return tuple: no longer return theGuido van Rossum1999-02-031-12/+8
| | | | | | f_fsid field, since it's not a scalar on all systems supporting this call (in particular, it's a tuple of two longs on AIX). Since it's not particularly useful, just nuke it. Adapted the doc strings too.
* Added documentation to the docstrings for the W*() functions that takeFred Drake1999-02-021-6/+8
| | | | a process exit status as a parameter.
* Add _P_WAIT etc. for NT.Guido van Rossum1999-02-011-0/+12
|
* spawnv, spawnve docstrings: added mode parameter; this is required!Fred Drake1999-02-011-2/+4
|
* Oops, the patch for NeXT always replaced waitpid() with wait4() --Guido van Rossum1999-02-011-0/+4
| | | | this doesn't exist everywhere, so go back to using #ifdef NeXT.
* Patches by William Lewis for Nextstep descendants.Guido van Rossum1999-01-271-25/+94
|
* Add spawnv and spawnve functions for Win32 platforms.Guido van Rossum1999-01-251-0/+178
|
* Only do ttyname() when HAVE_TTYNAME is defined.Guido van Rossum1999-01-251-0/+18
| | | | Also define F_OK etc. when not already defined, when doing access().
* Need extern decl. for fdatasync() in case it exists but isn't declaredGuido van Rossum1999-01-081-2/+2
| | | | | anywhere (or, more likely, the declaration requires a magical combination of _POSIX defines).
* Added fsync() and fdatasync(). Patches by Scott Cotton. RequiresGuido van Rossum1999-01-081-0/+57
| | | | HAVE_* macros set by configure script.
* Change the access() code to return 1 if granted, 0 if not granted.Guido van Rossum1999-01-061-4/+11
| | | | Patch (again) by Sean Reifschneider.
* Changes for long file support by Steve Clift.Guido van Rossum1999-01-061-14/+231
| | | | Also added access() and ttyname() by Sean Reifschneider.
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Use the t# format where appropriate. Greg Stein.Guido van Rossum1998-10-081-3/+3
|
* Removed some OS/2 #defines (now in the OS/2 specific config.h).Guido van Rossum1998-09-281-15/+0
| | | | Patch by Jeff Rush.
* In Win32 version of listdir(), when FindFirstFile() returnsGuido van Rossum1998-08-061-0/+2
| | | | | ERROR_FILE_NOT_FOUND, return an empty list instead of raising an exception.
* Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum1998-08-041-0/+5
|