/* File descriptors.
- Copyright (C) 1993,94,95,96,97,98 Free Software Foundation, Inc.
+ Copyright (C) 1993,94,95,96,97,98, 99 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
#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;
/* 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 error_t
_hurd_fd_error_signal (error_t err)
{
switch (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);
/* 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);
/* Lightweight user references for ports.
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1997, 1999 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
__result; })
-#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#ifndef _HURD_PORT_H_EXTERN_INLINE
+#define _HURD_PORT_H_EXTERN_INLINE extern __inline
#endif
/* Initialize *PORT to INIT. */
-_EXTERN_INLINE void
+_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_init (struct hurd_port *port, mach_port_t init)
{
__spin_lock_init (&port->lock);
/* Get a reference to *PORT, which is locked.
Pass return value and LINK to _hurd_port_free when done. */
-_EXTERN_INLINE mach_port_t
+_HURD_PORT_H_EXTERN_INLINE mach_port_t
_hurd_port_locked_get (struct hurd_port *port,
struct hurd_userlink *link)
{
/* Same, but locks PORT first. */
-_EXTERN_INLINE mach_port_t
+_HURD_PORT_H_EXTERN_INLINE mach_port_t
_hurd_port_get (struct hurd_port *port,
struct hurd_userlink *link)
{
/* Free a reference gotten with `USED_PORT = _hurd_port_get (PORT, LINK);' */
-_EXTERN_INLINE void
+_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_free (struct hurd_port *port,
struct hurd_userlink *link,
mach_port_t used_port)
/* Set *PORT's port to NEWPORT. NEWPORT's reference is consumed by PORT->port.
PORT->lock is locked. */
-_EXTERN_INLINE void
+_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_locked_set (struct hurd_port *port, mach_port_t newport)
{
mach_port_t old;
/* Same, but locks PORT first. */
-_EXTERN_INLINE void
+_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_set (struct hurd_port *port, mach_port_t newport)
{
HURD_CRITICAL_BEGIN;
/* Implementing POSIX.1 signals under the Hurd.
- Copyright (C) 1993, 94, 95, 96, 98 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 98, 99 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
by different threads. */
__attribute__ ((__const__));
-_EXTERN_INLINE struct hurd_sigstate *
+#ifndef _HURD_SIGNAL_H_EXTERN_INLINE
+#define _HURD_SIGNAL_H_EXTERN_INLINE extern __inline
+#endif
+
+_HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate *
_hurd_self_sigstate (void)
{
struct hurd_sigstate **location =
interrupted lest the signal handler try to take the same lock and
deadlock result. */
-_EXTERN_INLINE void *
+_HURD_SIGNAL_H_EXTERN_INLINE void *
_hurd_critical_section_lock (void)
{
struct hurd_sigstate **location =
return ss;
}
-_EXTERN_INLINE void
+_HURD_SIGNAL_H_EXTERN_INLINE void
_hurd_critical_section_unlock (void *our_lock)
{
if (our_lock == NULL)
/* Internal per-thread variables for the Hurd.
- Copyright (C) 1994, 95, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 97, 98, 99 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
};
-#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#ifndef _HURD_THREADVAR_H_EXTERN_INLINE
+#define _HURD_THREADVAR_H_EXTERN_INLINE extern __inline
#endif
/* Return the location of the value for the per-thread variable with index
INDEX used by the thread whose stack pointer is SP. */
-_EXTERN_INLINE unsigned long int *
+_HURD_THREADVAR_H_EXTERN_INLINE unsigned long int *
__hurd_threadvar_location_from_sp (enum __hurd_threadvar_index __index,
void *__sp)
{
the same stack frame by different threads. */
__attribute__ ((__const__));
-_EXTERN_INLINE unsigned long int *
+_HURD_THREADVAR_H_EXTERN_INLINE unsigned long int *
__hurd_threadvar_location (enum __hurd_threadvar_index __index)
{
return __hurd_threadvar_location_from_sp (__index,
/* Return the current thread's location for `errno'.
The syntax of this function allows redeclarations like `int errno'. */
-_EXTERN_INLINE int *
+_HURD_THREADVAR_H_EXTERN_INLINE int *
__hurd_errno_location (void)
{
return (int *) __hurd_threadvar_location (_HURD_THREADVAR_ERRNO);
/* Support for chains recording users of a resource; `struct hurd_userlink'.
- Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1997, 1999 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
};
-#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
+#ifndef _HURD_USERLINK_H_EXTERN_INLINE
+#define _HURD_USERLINK_H_EXTERN_INLINE extern __inline
#endif
/* Attach LINK to the chain of users at *CHAINP. */
-_EXTERN_INLINE void
+_HURD_USERLINK_H_EXTERN_INLINE void
_hurd_userlink_link (struct hurd_userlink **chainp,
struct hurd_userlink *link)
{
/* Detach LINK from its chain. Returns nonzero iff this was the
last user of the resource and it should be deallocated. */
-_EXTERN_INLINE int
+_HURD_USERLINK_H_EXTERN_INLINE int
_hurd_userlink_unlink (struct hurd_userlink *link)
{
/* We should deallocate the resource used if this chain has been detached
value is zero, someone is still using the resource and they will
deallocate it when they are finished. */
-_EXTERN_INLINE int
+_HURD_USERLINK_H_EXTERN_INLINE int
_hurd_userlink_clear (struct hurd_userlink **chainp)
{
if (*chainp == NULL)