summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Patch by Jody Winston (with my changes) to add some of the "waitGuido van Rossum1998-08-041-0/+151
| | | | | status inspection" macros as functions: WEXITSTATUS(), WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
* Several changes to support inclusion of filename in releventBarry Warsaw1998-07-231-13/+21
| | | | | | | | | | | | | | | | | | | | | exceptions: posix_error_with_filename(): New function which calls PyErr_SetFromErrnoWithFilename() The following methods have been changed to call posix_error_with_filename(): posix_1str() posix_strint() posix_strintint() posix_do_stat() posix_mkdir() posix_utime() posix_readlink() posix_open() INITFUNC(): os.error (nee PosixError) is PyExc_OSError
* On Windows, make the pipe() call return Unix file descriptors insteadGuido van Rossum1998-06-121-2/+5
| | | | | of Windows file handles. Now it is at least compatible with itself on Unix!
* Moved some #ifdefs around that got put in the wrong place by theGuido van Rossum1997-12-291-16/+22
| | | | latest OS/2 patch set.
* Another large batch of patches from Jeff Rush for OS/2.Guido van Rossum1997-12-051-15/+243
| | | | I hope this time I've taken out all // comments and indended #ifdefs.
* Patch for QNX, by Chris Herborth. Also left-aligned preprocessorGuido van Rossum1997-12-021-58/+58
| | | | directives and changed C++ comments to C comments.
* os2 patch by Jeff RushGuido van Rossum1997-11-221-5/+252
|
* This fix (across 4 files in 3 directories) solves a subtle problem withGuido van Rossum1997-11-141-0/+1
| | | | | | | | | | | | | | | signal handlers in a fork()ed child process when Python is compiled with thread support. The bug was reported by Scott <scott@chronis.icgroup.com>. What happens is that after a fork(), the variables used by the signal module to determine whether this is the main thread or not are bogus, and it decides that no thread is the main thread, so no signals will be delivered. The solution is the addition of PyOS_AfterFork(), which fixes the signal module's variables. A dummy version of the function is present in the intrcheck.c source file which is linked when the signal module is not used.
* Apply two changes, systematically:Guido van Rossum1997-10-011-52/+16
| | | | | | | | | | | | | | | | | (1) Use PyErr_NewException("module.class", NULL, NULL) to create the exception object. (2) Remove all calls to Py_FatalError(); instead, return or ignore the errors -- the import code now checks PyErr_Occurred() after calling a module's init function, so it's no longer a fatal error for the initialization to fail. Also did some small cleanups, e.g. removed unnecessary test for "already initialized" from initfpectl(), and unified initposix()/initnt(). I haven't checked this very thoroughly, so while the changes are pretty trivial -- beware of untested code!
* Add strerror() interface.Guido van Rossum1997-09-151-2/+30
|
* Added /**/ around #end tagsGuido van Rossum1997-08-211-1/+1
|
* Added a bunch of XXX comments about things I'd like to see changed...Guido van Rossum1997-08-141-1/+8
|
* Added O_BINARY and O_TEXT (for Windows).Guido van Rossum1997-08-081-0/+6
|
* Moved the definition of posix_times__doc__ to outside of #ifdef HAVE_TIMESRoger E. Masse1997-06-051-3/+3
| | | | so that MSVC 4.2 doesn't complain under NT.
* Added doc strings (Neil Schemenauer).Guido van Rossum1997-06-021-59/+364
|