From 916f1569078e9da233898694c62cd3ad039e803c Mon Sep 17 00:00:00 2001 From: Svante Signell Date: Tue, 29 Oct 2019 23:52:55 +0100 Subject: fs: Support for file record locking 2019-02-01 Svante Signell * Update copyright years. 2018-01-05 Svante Signell * Update copyright years. * fs.defs: Add new argument rendezvous: mach_port_send_t to RPC file_record_lock. 2017-01-05 Svante Signell * Update copyright years and headers. 2016-05-23 Svante Signell * fs.defs: Added description. * hurd_types.defs: Make struct flock_t seven integers long since l_start and l_len are 64bit. * hurd_types.h: typedef flock_t as flock64. 2001-04-10 Neal H Walfield * fs.defs: New RPC file_record_lock. * hurd_types.defs: Import . --- hurd/fs.defs | 39 +++++++++++++++++++++++++-------------- hurd/hurd_types.defs | 30 ++++++++++++++++-------------- hurd/hurd_types.h | 30 +++++++++++++++--------------- 3 files changed, 56 insertions(+), 43 deletions(-) diff --git a/hurd/fs.defs b/hurd/fs.defs index 1460131a..52f9cd37 100644 --- a/hurd/fs.defs +++ b/hurd/fs.defs @@ -1,23 +1,22 @@ /* Definitions for the filesystem interface. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2010 - Free Software Foundation, Inc. -This file is part of the GNU Hurd. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2010, 2014-2019 + Free Software Foundation, Inc. -The GNU Hurd is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This file is part of the GNU Hurd. -The GNU Hurd is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + The GNU Hurd is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -You should have received a copy of the GNU General Public License -along with the GNU Hurd; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + The GNU Hurd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with the GNU Hurd. If not, see . */ /* All these objects also implement the generic IO facilities. */ @@ -358,6 +357,7 @@ routine file_reparent ( skip; /* Was: file_get_children. */ skip; /* Was: file_get_source. */ + /* Overlay a task with a file. Necessary initialization, including authentication changes associated with set[ug]id execution must be handled by the filesystem. Filesystems normally implement this by @@ -386,3 +386,14 @@ routine file_utimens ( RPT new_atime: timespec_t; new_mtime: timespec_t); + +/* Do fcntl type locking on FILE. CMD is from the set F_GETLK64, + F_SETLK64, F_SETLKW64. FLOCK64 is passed by the user and is as + defined by . RENDEZVOUS is MACH_PORT_NULL for per opened + file locking and !MACH_PORT_NULL for per process file locking */ +routine file_record_lock ( + file: file_t; + RPT + cmd: int; + inout flock64: flock_t; + rendezvous: mach_port_send_t); diff --git a/hurd/hurd_types.defs b/hurd/hurd_types.defs index f0d1a351..88024045 100644 --- a/hurd/hurd_types.defs +++ b/hurd/hurd_types.defs @@ -1,22 +1,22 @@ /* MiG type declarations for Hurd interfaces -*- C -*- - Copyright (C) 1993,94,95,96,98,2001,02,17 Free Software Foundation, Inc. -This file is part of the GNU Hurd. + Copyright (C) 1993-1996, 1998, 2001, 2002, 2014-2019 + Free Software Foundation, Inc. -The GNU Hurd is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This file is part of the GNU Hurd. -The GNU Hurd is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + The GNU Hurd is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -You should have received a copy of the GNU General Public License -along with the GNU Hurd; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + The GNU Hurd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with the GNU Hurd. If not, see . */ #ifdef HURD_SERVER /* The Hurd uses protected payloads to quickly look up the object @@ -407,7 +407,7 @@ type idarray_t = array[] of uid_t; type rusage_t = struct[18] of int; /* XXX */ -type flock_t = struct[5] of int; +type flock_t = struct[7] of int; /* l_start and l_len are 64 bit */ type timespec_t = struct[2] of int; @@ -421,3 +421,5 @@ import ; import ; import ; import ; +import ; + diff --git a/hurd/hurd_types.h b/hurd/hurd_types.h index 64b46d15..288dcc2f 100644 --- a/hurd/hurd_types.h +++ b/hurd/hurd_types.h @@ -1,22 +1,22 @@ /* C declarations for Hurd server interfaces - Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, - 2010, 2017 Free Software Foundation, Inc. -This file is part of the GNU Hurd. + Copyright (C) 1993-1996, 1998, 1999, 2001, 2002, 2010, 2014-2019 + Free Software Foundation, Inc. -The GNU Hurd is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This file is part of the GNU Hurd. -The GNU Hurd is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + The GNU Hurd is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -You should have received a copy of the GNU General Public License -along with the GNU Hurd; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + The GNU Hurd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Hurd. If not, see . */ #ifndef _HURD_TYPES_H #define _HURD_TYPES_H @@ -74,7 +74,7 @@ typedef const uid_t *const_idarray_t; typedef __loff_t *off_array_t; typedef const __loff_t *const_off_array_t; typedef struct rusage rusage_t; -typedef struct flock flock_t; +typedef struct flock64 flock_t; typedef struct utsname utsname_t; #if _FILE_OFFSET_BITS == 64 typedef struct stat io_statbuf_t; -- cgit v1.2.3