aboutsummaryrefslogtreecommitdiff
path: root/trans/null.c
Commit message (Collapse)AuthorAgeFilesLines
* trans: drop privileges in the null translatorJustus Winter2013-08-281-0/+5
| | | | * trans/null.c (main): Drop privileges.
* Add io_select_timeout to the io interfaceRichard Braun2013-02-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes a problem that can occur with non-blocking (and also blocking for very short times) select/poll calls. The problem occurs because the timeout is implemented at the client side. For a non-blocking call, this means that (depending on the code path taken in the C library) the client could get a timeout without a full RPC round-trip to the server. Moving the implementation of the timeout to the servers guarantees a full round-trip, and correct results for non-blocking calls. The modifications in this change depend on the availability of the recently added pthread_hurd_cond_timedwait_np function in libpthread. * boot/boot.c (io_select_common): New static function. (S_io_select): Use io_select_common. (S_io_select_timeout): New function which makes use of io_select_common. * console-client/kbd-repeat.c (repeater_select): Add a timeout parameter. * console-client/pc-mouse.c (repeater_select): Likewise. * console-client/trans.c (io_select_common): New static function. (netfs_S_io_select): Use io_select_common. (netfs_S_io_select_timeout): New function which makes use of io_select_common. * console-client/trans.h (struct consnode): Add a timeout parameter. * hurd/io.defs (io_select_timeout): New MIG routine. * hurd/io_reply.defs (io_select_timeout_reply): New MIG simpleroutine. * hurd/io_request.defs (io_select_timeout_request): Likewise. * libdiskfs/io-select.c (diskfs_S_io_select_timeout): New function. * libnetfs/io-select.c (netfs_S_io_select_timeout): Likewise. * libpipe/pipe.c (pipe_pair_select): Add a timeout parameter. * libpipe/pipe.h (pipe_select_readable): Likewise. (pipe_select_writable): Likewise. (pipe_pair_select): Likewise. * libpipe/pq.h: Include <hurd/hurd_types.h>. * libtrivfs/io-select.c (trivfs_S_io_select_timeout): New function. * pfinet/glue-include/linux/sched.h: Include <errno.h>. (interruptible_sleep_on): Function removed, replaced with ... (interruptible_sleep_on_timeout): New function. (schedule): Update to use interruptible_sleep_on_timeout. (schedule_timeout): Likewise. * pfinet/io-ops.c (io_select_common): New static function. (S_io_select): Use io_select_common. (S_io_select_timeout): New function which makes use of io_select_common. * pfinet/tunnel.c (io_select_common): New static function. (trivfs_S_io_select): Use io_select_common. (trivfs_S_io_select_timeout): New function which makes use of io_select_common. * pflocal/connq.c (connq_listen): Replace noblock with a timeout parameter. * pflocal/connq.h: Include <hurd/hurd_types.h>. (connq_listen): Update declaration to replace noblock with a timeout parameter. * pflocal/io.c (io_select_common): New static function. (S_io_select): Use io_select_common. (S_io_select_timeout): New function which makes use of io_select_common. * pflocal/socket.c (S_socket_accept): Update call to connq_listen to match new declaration. * storeio/io.c (trivfs_S_io_select_timeout): New function. * term/ptyio.c (pty_io_select): Add a timeout parameter. * term/term.h (pty_io_select): Likewise. * term/users.c (io_select_common): New static function. (trivfs_S_io_select): Use io_select_common. (trivfs_S_io_select_timeout): New function which makes use of io_select_common. * trans/fifo.c (io_select_common): New static function. (trivfs_S_io_select): Use io_select_common. (trivfs_S_io_select_timeout): New function which makes use of io_select_common. * trans/firmlink.c (trivfs_S_io_select_timeout): New function. * trans/new-fifo.c (io_select_common): New static function. (trivfs_S_io_select): Use io_select_common. (trivfs_S_io_select_timeout): New function which makes use of io_select_common. * trans/null.c (trivfs_S_io_select_timeout): New function. * trans/streamio.c (io_select_common): New static function. (trivfs_S_io_select): Use io_select_common. (trivfs_S_io_select_timeout): New function which makes use of io_select_common.
* 2003-09-05 Greg Buchholz <greg@sleepingsquirrel.org>Roland McGrath2003-09-061-2/+2
| | | | | * fifo.c, new-fifo.c, null.c (trivfs_S_io_map): Change return value to EOPNOTSUPP (was EINVAL).
* 2002-06-13 Roland McGrath <roland@frob.com>Roland McGrath2002-06-131-12/+15
| | | | | | | | | | | | | | | * firmlink.c (trivfs_S_io_read): Fix type of DATA argument. * streamio.c (trivfs_S_io_read): Likewise. (trivfs_S_io_write): Likewise. * hello.c (trivfs_S_io_read): Likewise. * hello-mt.c (trivfs_S_io_read): Likewise. * null.c (trivfs_S_io_read): Likewise. (trivfs_S_io_write): Likewise. (trivfs_S_file_set_size): Add reply port args. * null.c (trivfs_S_io_map): Add reply port args. (trivfs_S_io_read, trivfs_S_io_write): off_t -> loff_t (trivfs_S_file_set_size): Likewise. (trivfs_S_io_select): Remove bogus last arg.
* 2001-02-25 Roland McGrath <roland@frob.com>Roland McGrath2001-02-261-3/+3
| | | | | | | | | | | * symlink.c: Include <string.h> for decls of built-ins. * firmlink.c: Include <stdlib.h> for exit decl. * ifsock.c: Likewise. * null.c: Likewise. * magic.c: Likewise. * fifo.c: Likewise. * hello.c: Likewise. * hello-mt.c: Likewise.
* 1999-12-03 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-12-031-2/+26
| | | | | | | | | * null.c: Support --full/-f option to be /dev/full (ENOSPC writes). (write_error_code): New variable. (options, argp): New static const variables. (parse_opt): New function. (main): Move local ARGP out to static. (trivfs_S_io_write): Return write_error_code instead of zero.
* Reverted changes related to io_map_segment.Roland McGrath1999-09-131-6/+5
|
* 1999-09-07 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-09-081-5/+6
| | | | | | | | | * null.c (trivfs_S_io_map): Renamed to ... (trivfs_S_io_map_segment): ... here, with new parameter `index'. * new-fifo.c (trivfs_S_io_map): Renamed to ... (trivfs_S_io_map_segment): ... here, with new parameter `index'. * fifo.c (trivfs_S_io_map): Renamed to ... (trivfs_S_io_map_segment): ... here, with new parameter `index'.
* 1999-08-31 Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>Roland McGrath1999-09-011-0/+1
| | | | | | | | | | * bogus-fifo.c (main): Deallocate bootstrap port after using it. * fifo.c (main): Likewise. * firmlink.c (main): Likewise. * ifsock.c (main): Likewise. * magic.c (main): Likewise. * null.c (main): Likewise. * symlink.c (main): Likewise.
* 1999-05-19 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-05-201-8/+7
| | | | | * null.c (trivfs_S_io_read): Fix return value. Reported by Steinar Hamre <steinarh@fim.ntnu.no>.
* 1998-07-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1998-07-201-4/+4
| | | | | | | | | * firmlink.c (main): Fix return type to int, and use return. * fwd.c (main): Likewise. * new-fifo.c (main): Likewise. * magic.c (main): Likewise. * fifo.c (main): Likewise. * null.c (main): Likewise.
* (main):Miles Bader1997-09-041-1/+1
| | | | Fix typo.
* Wed Aug 20 14:07:56 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>Thomas Bushnell1997-08-201-1/+1
| | | | | | | | | * crash.c (main): New args for ports_manage_port_operations_multithread. * fifo.c (main): Likewise. * firmlink.c (main): Likewise. * new-fifo.c (main): Likewise. * null.c (main): Likewise.
* .Miles Bader1997-03-011-1/+2
|
* (argp_program_version): Make const.Miles Bader1997-02-201-1/+1
|
* (control_class, node_class, port_bucket, trivfs_protid_port_class,Miles Bader1997-02-201-20/+5
| | | | | | | | trivfs_cntl_portclasses, trivfs_protid_nportclasses, trivfs_cntl_nportclasses): Variables removed. (main): Don't use them.
* (trivfs_S_file_check_access):Miles Bader1996-09-261-11/+0
| | | | Function removed (trivfs default is now sufficient).
* (trivfs_S_io_readable):Miles Bader1996-09-241-46/+22
| | | | | | | | | | | | | | Always return 0. (argp_program_version): New variable. (provide_zeros): Variable removed. (main): Use argp for argument parsing. (trivfs_S_io_read): Don't return zeros anymore. (trivfs_S_file_check_access): New function.
* (main): Add flags argument to trivfs_startup call.Miles Bader1995-11-061-1/+1
|
* (trivfs_S_file_set_size): Renamed from trivfs_S_file_truncate.Miles Bader1995-09-181-1/+1
|
* (trivfs_goaway, trivfs_modify_stat): Update arguments.Miles Bader1995-08-241-4/+2
|
* (PT_CTL, PT_NODE): Deleted macros.Michael I. Bushnell1995-06-281-56/+20
| | | | | | | | | | | | | | | | (trivfs_protid_porttypes, trivfs_cntl_porttypes, trivfs_protid_nporttypes, trivfs_cntl_nporttypes): Deleted vars. (trivfs_protid_portclasses, trivfs_cntl_portclasses, trivfs_protid_nportclasses, trivfs_cntl_nportclasses): New vars. (control_class, node_class, port_bucket): New vars. (main): Initialize control_class, node_class, port_bucket, trivfs_protid_portclasses, and trivfs_cntl_portclasses. (ports_cleanroutines): Delete initialization. (main): Convert to new trivfs interface. (trivfs_goaway): Likewise. (main): Convert to new ports interface. (ports_demuxer, ports_notice_idle, ports_no_live_ports, ports_no_hard_ports): Deleted functions.
* (trivfs_modify_stat): Make st_blksize really large.Miles Bader1995-05-111-1/+1
|
* (trivfs_S_file_truncate): Always return 0, so O_TRUNC works.Miles Bader1995-04-111-3/+1
|
* Use trivfs_startup() instead of doing things manually.Miles Bader1995-04-091-18/+5
| | | | Get rid of _libports_initialize() [it gets called automatically].
* Return more useful values for the st_blksize and st_fstype fields in a stat.Miles Bader1995-04-031-1/+3
|
* Move the check for the bootstrap port after the args check, so that users canMiles Bader1995-03-311-4/+4
| | | | run it from the shell to get a usage message.
* Initial revisionMiles Bader1995-03-301-0/+394