* sysdeps/mach/hurd/xstat64.c: Conditionalize entire contents of the
[platform/upstream/glibc.git] / hurd / hurd / fd.h
index 7e5a978..198791b 100644 (file)
@@ -1,27 +1,30 @@
 /* File descriptors.
-   Copyright (C) 1993,94,95,96,97,98, 99 Free Software Foundation, Inc.
+   Copyright (C) 1993,94,95,96,97,98,99,2000,01,02
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library 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
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef        _HURD_FD_H
 
 #define        _HURD_FD_H      1
 #include <features.h>
 
+#include <cthreads.h>
+
 #include <hurd/hurd_types.h>
 #include <hurd/port.h>
 
@@ -47,17 +50,16 @@ extern struct hurd_fd **_hurd_dtable;
 extern struct mutex _hurd_dtable_lock; /* Locks those two variables.  */
 \f
 #include <hurd/signal.h>
-#include <lock-intern.h>
 
-#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#ifndef _HURD_FD_H_EXTERN_INLINE
+#define _HURD_FD_H_EXTERN_INLINE extern __inline
 #endif
 
 /* Returns the descriptor cell for FD.  If FD is invalid or unused, return
    NULL.  The cell is unlocked; when ready to use it, lock it and check for
    it being unused.  */
 
-_EXTERN_INLINE struct hurd_fd *
+_HURD_FD_H_EXTERN_INLINE struct hurd_fd *
 _hurd_fd_get (int fd)
 {
   struct hurd_fd *descriptor;
@@ -134,7 +136,7 @@ _hurd_fd_get (int fd)
 /* Check if ERR should generate a signal.
    Returns the signal to take, or zero if none.  */
 
-_EXTERN_INLINE error_t
+_HURD_FD_H_EXTERN_INLINE int
 _hurd_fd_error_signal (error_t err)
 {
   switch (err)
@@ -155,7 +157,7 @@ _hurd_fd_error_signal (error_t err)
    always use this function to handle errors from RPCs made on file
    descriptor ports.  Some errors are translated into signals.  */
 
-_EXTERN_INLINE error_t
+_HURD_FD_H_EXTERN_INLINE error_t
 _hurd_fd_error (int fd, error_t err)
 {
   int signo = _hurd_fd_error_signal (err);
@@ -171,7 +173,7 @@ _hurd_fd_error (int fd, error_t err)
 /* Handle error code ERR from an RPC on file descriptor FD's port.
    Set `errno' to the appropriate error code, and always return -1.  */
 
-_EXTERN_INLINE int
+_HURD_FD_H_EXTERN_INLINE int
 __hurd_dfail (int fd, error_t err)
 {
   errno = _hurd_fd_error (fd, err);
@@ -213,9 +215,9 @@ extern error_t _hurd_fd_close (struct hurd_fd *fd);
    If successful, stores the amount actually read or written in *NBYTES.  */
 
 extern error_t _hurd_fd_read (struct hurd_fd *fd,
-                             void *buf, size_t *nbytes, off_t offset);
+                             void *buf, size_t *nbytes, loff_t offset);
 extern error_t _hurd_fd_write (struct hurd_fd *fd,
-                              const void *buf, size_t *nbytes, off_t offset);
+                              const void *buf, size_t *nbytes, loff_t offset);
 
 
 /* Call *RPC on PORT and/or CTTY; if a call on CTTY returns EBACKGROUND,