summaryrefslogtreecommitdiff
path: root/trans/null.c
AgeCommit message (Collapse)Author
2016-06-04Do not make io_select return errors on unsupported READ/WRITE modeSamuel Thibault
The descriptor is valid, it is just the mode which is not available. * console-client/kbd-repeat.c (repeater_select): Drop SELECT_URG flag from `type'. Return 0 instead of EINVAL if `type' contains SELECT_WRITE. * console-client/pc-mouse (repeater_select): Likewise. * trans/mtab.c (trivfs_S_io_select): Return 0 instead of EBADF when the openmodes do not match the requested modes in `type'. * trans/new-fifo.c (io_select_common): Likewise. * trans/fifo.c (io_select_common): Likewise. * trans/null.c (trivfs_S_io_select): Likewise. * trans/streamio.c (io_select_common): Likewise.
2014-04-15Include the MIG-generated server header filesJustus Winter
This enables the compiler to check that the server function declarations match MIGs expectations. Fix a few oddities along the way. * console-client/trans.c: Include MIG-generated server header file(s). * console/console.c: Likewise. Also, fix declarations. * console/mutations.h (TIOCTL_IMPORTS): Just use libnetfs/priv.h. * console/priv.h: Delete now unused file. * ext2fs/storeinfo.c: Include MIG-generated server header file(s). * fatfs/inode.c: Likewise. * fatfs/main.c: Likewise. Also, fix declaration. * isofs/inode.c: Likewise. * libdiskfs/boot-start.c: Likewise. * libdiskfs/file-chg.c: Include the correct MIG-generated server header file. * libdiskfs/file-chmod.c: Include MIG-generated server header file(s). * libdiskfs/file-get-fs-opts.c: Likewise. * libdiskfs/init-startup.c: Likewise. * libnetfs/file-get-children.c: Likewise. * libnetfs/file-getcontrol.c: Include the correct MIG-generated server header file. * libnetfs/file-set-translator.c: Include MIG-generated server header file(s). * libnetfs/fsstubs.c: Likewise. * libtrivfs/file-access.c: Likewise. * libtrivfs/file-chauthor.c: Likewise. * libtrivfs/file-chflags.c: Likewise. * libtrivfs/file-chg.c: Likewise. * libtrivfs/file-chmod.c: Likewise. * libtrivfs/file-chown.c: Likewise. * libtrivfs/file-exec.c: Likewise. * libtrivfs/file-get-children.c: Likewise. * libtrivfs/file-get-fs-options.c: Likewise. * libtrivfs/file-get-source.c: Likewise. * libtrivfs/file-get-storage-info.c: Likewise. * libtrivfs/file-get-trans.c: Likewise. * libtrivfs/file-get-transcntl.c: Likewise. * libtrivfs/file-getcontrol.c: Likewise. * libtrivfs/file-getfh.c: Likewise. * libtrivfs/file-getlinknode.c: Likewise. * libtrivfs/file-lock.c: Likewise. * libtrivfs/file-reparent.c: Likewise. * libtrivfs/file-set-size.c: Likewise. * libtrivfs/file-set-trans.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * libtrivfs/file-sync.c: Likewise. * libtrivfs/file-syncfs.c: Likewise. * libtrivfs/file-utimes.c: Likewise. * libtrivfs/fsys-forward.c: Likewise. * libtrivfs/fsys-get-options.c: Likewise. * libtrivfs/fsys-getroot.c: Likewise. * libtrivfs/fsys-goaway.c: Likewise. * libtrivfs/fsys-set-options.c: Likewise. * libtrivfs/fsys-stubs.c: Likewise. * libtrivfs/fsys-syncfs.c: Likewise. * libtrivfs/io-async-icky.c: Likewise. * libtrivfs/io-async.c: Likewise. * libtrivfs/io-duplicate.c: Likewise. * libtrivfs/io-identity.c: Likewise. * libtrivfs/io-map.c: Likewise. * libtrivfs/io-modes-get.c: Likewise. * libtrivfs/io-modes-off.c: Likewise. * libtrivfs/io-modes-on.c: Likewise. * libtrivfs/io-modes-set.c: Likewise. * libtrivfs/io-owner-get.c: Likewise. * libtrivfs/io-owner-mod.c: Likewise. * libtrivfs/io-pathconf.c: Likewise. * libtrivfs/io-read.c: Likewise. * libtrivfs/io-readable.c: Likewise. * libtrivfs/io-reauthenticate.c: Likewise. * libtrivfs/io-restrict-auth.c: Likewise. * libtrivfs/io-revoke.c: Likewise. * libtrivfs/io-seek.c: Likewise. * libtrivfs/io-select.c: Likewise. * libtrivfs/io-stat.c: Likewise. * libtrivfs/io-stubs.c: Likewise. * libtrivfs/io-version.c: Likewise. * libtrivfs/io-write.c: Likewise. * pfinet/tunnel.c: Likewise. * storeio/io.c: Likewise. * storeio/storeio.c: Likewise. * term/users.c: Likewise. * tmpfs/node.c: Likewise. * trans/fakeroot.c: Likewise. Also, include all server headers that provide the X_server_routine functions... (netfs_demuxer): ... that were previously declared here. * trans/fifo.c: Include MIG-generated server header file(s). * trans/firmlink.c: Likewise. * trans/hello-mt.c: Likewise. * trans/hello.c: Likewise. * trans/magic.c: Likewise. * trans/mtab.c: Likewise. * trans/new-fifo.c: Likewise. * trans/null.c: Likewise. * trans/proxy-defpager.c: Likewise. * trans/streamio.c: Likewise. * libdiskfs/fsmutations.h: Qualify the import with the libraries path. Without this change, out-of-tree builds would no longer work. * libnetfs/mutations.h: Likewise. * libtrivfs/mig-mutate.h: Likewise.
2013-10-02Check for negative sizes in file_set_sizeRichard Braun
* libdiskfs/file-set-size.c (diskfs_S_file_set_size): Return EINVAL if size is negative. * libnetfs/file-set-size.c (netfs_S_file_set_size): Likewise. * libtreefs/s-file.c (treefs_S_file_set_size): Likewise. * storeio/io.c (trivfs_S_file_set_size): Likewise. * term/users.c (trivfs_S_file_set_size): Likewise. * trans/null.c (trivfs_S_file_set_size): Likewise. * trans/streamio.c (trivfs_S_file_set_size): Likewise.
2013-08-28trans: drop privileges in the null translatorJustus Winter
* trans/null.c (main): Drop privileges.
2013-02-28Add io_select_timeout to the io interfaceRichard Braun
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-062003-09-05 Greg Buchholz <greg@sleepingsquirrel.org>Roland McGrath
* fifo.c, new-fifo.c, null.c (trivfs_S_io_map): Change return value to EOPNOTSUPP (was EINVAL).
2002-06-132002-06-13 Roland McGrath <roland@frob.com>Roland McGrath
* 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-262001-02-25 Roland McGrath <roland@frob.com>Roland McGrath
* 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-031999-12-03 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* 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.
1999-09-13Reverted changes related to io_map_segment.Roland McGrath
1999-09-081999-09-07 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* 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-09-011999-08-31 Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>Roland McGrath
* 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-201999-05-19 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* null.c (trivfs_S_io_read): Fix return value. Reported by Steinar Hamre <steinarh@fim.ntnu.no>.
1998-07-201998-07-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* 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.
1997-09-04(main):Miles Bader
Fix typo.
1997-08-20Wed Aug 20 14:07:56 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>Thomas Bushnell
* 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.
1997-03-01.Miles Bader
1997-02-20(argp_program_version): Make const.Miles Bader
1997-02-20(control_class, node_class, port_bucket, trivfs_protid_port_class,Miles Bader
trivfs_cntl_portclasses, trivfs_protid_nportclasses, trivfs_cntl_nportclasses): Variables removed. (main): Don't use them.
1996-09-26(trivfs_S_file_check_access):Miles Bader
Function removed (trivfs default is now sufficient).
1996-09-24(trivfs_S_io_readable):Miles Bader
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.
1995-11-06(main): Add flags argument to trivfs_startup call.Miles Bader
1995-09-18(trivfs_S_file_set_size): Renamed from trivfs_S_file_truncate.Miles Bader
1995-08-24(trivfs_goaway, trivfs_modify_stat): Update arguments.Miles Bader
1995-06-28(PT_CTL, PT_NODE): Deleted macros.Michael I. Bushnell
(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.
1995-05-11(trivfs_modify_stat): Make st_blksize really large.Miles Bader
1995-04-11(trivfs_S_file_truncate): Always return 0, so O_TRUNC works.Miles Bader
1995-04-09Use trivfs_startup() instead of doing things manually.Miles Bader
Get rid of _libports_initialize() [it gets called automatically].
1995-04-03Return more useful values for the st_blksize and st_fstype fields in a stat.Miles Bader
1995-03-31Move the check for the bootstrap port after the args check, so that users canMiles Bader
run it from the shell to get a usage message.
1995-03-30Initial revisionMiles Bader