mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Changes for new UNIX-specific built-in module 'select' and new header for
interfaces to variants of select() system call, "myselect.h". This includes adding fileno() methods to files, sockets and stdwin.
This commit is contained in:
parent
5dc8eb0914
commit
ed233a5696
7 changed files with 321 additions and 19 deletions
|
@ -221,6 +221,16 @@ file_tell(f, args)
|
|||
return newintobject(offset);
|
||||
}
|
||||
|
||||
static object *
|
||||
file_fileno(f, args)
|
||||
fileobject *f;
|
||||
object *args;
|
||||
{
|
||||
if (!getnoarg(args))
|
||||
return NULL;
|
||||
return newintobject((long) fileno(f->f_fp));
|
||||
}
|
||||
|
||||
static object *
|
||||
file_flush(f, args)
|
||||
fileobject *f;
|
||||
|
@ -462,6 +472,7 @@ file_write(f, args)
|
|||
static struct methodlist file_methods[] = {
|
||||
{"close", file_close},
|
||||
{"flush", file_flush},
|
||||
{"fileno", file_fileno},
|
||||
{"isatty", file_isatty},
|
||||
{"read", file_read},
|
||||
{"readline", file_readline},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue