5.1 OS Utilities

int Py_FdIsInteractive (FILE *fp, char *filename)
Return true (nonzero) if the standard I/O file fp with name filename is deemed interactive. This is the case for files for which "isatty(fileno(fp))" is true. If the global flag Py_InteractiveFlag is true, this function also returns true if the name pointer is NULL or if the name is equal to one of the strings '<stdin>' or '???'.

long PyOS_GetLastModificationTime (char *filename)
Return the time of last modification of the file filename. The result is encoded in the same way as the timestamp returned by the standard C library function time().

void PyOS_AfterFork ()
Function to update some internal state after a process fork; this should be called in the new process if the Python interpreter will continue to be used. If a new executable is loaded into the new process, this function does not need to be called.

int PyOS_CheckStack ()
Return true when the interpreter runs out of stack space. This is a reliable check, but is only available when USE_STACKCHECK is defined (currently on Windows using the Microsoft Visual C++ compiler and on the Macintosh). USE_CHECKSTACK will be defined automatically; you should never change the definition in your own code.

PyOS_sighandler_t PyOS_getsig (int i)
Return the current signal handler for signal i. This is a thin wrapper around either sigaction or signal. Do not call those functions directly! PyOS_sighandler_t is a typedef alias for void (*)(int).

PyOS_sighandler_t PyOS_setsig (int i, PyOS_sighandler_t h)
Set the signal handler for signal i to be h; return the old signal handler. This is a thin wrapper around either sigaction or signal. Do not call those functions directly! PyOS_sighandler_t is a typedef alias for void (*)(int).


See About this document... for information on suggesting changes.