Fixed insertion sort errors in includes and prototypes. This was more
than a style bug for the includes -- queue.h is a prerequisite for _lock.h and _mutex.h but was included after them. Removed bogus prototype for fget_locked(). The prototype was originally needed to support K&R but was bogotified by converting the function header to new-style.
This commit is contained in:
parent
32d7144dbc
commit
9e7514ca3a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126590
@ -37,10 +37,10 @@
|
|||||||
#ifndef _SYS_FILEDESC_H_
|
#ifndef _SYS_FILEDESC_H_
|
||||||
#define _SYS_FILEDESC_H_
|
#define _SYS_FILEDESC_H_
|
||||||
|
|
||||||
|
#include <sys/queue.h>
|
||||||
#include <sys/_lock.h>
|
#include <sys/_lock.h>
|
||||||
#include <sys/_mutex.h>
|
#include <sys/_mutex.h>
|
||||||
#include <sys/limits.h> /* XXX for CHAR_BIT */
|
#include <sys/limits.h> /* XXX for CHAR_BIT */
|
||||||
#include <sys/queue.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This structure is used for the management of descriptors. It may be
|
* This structure is used for the management of descriptors. It may be
|
||||||
@ -98,8 +98,6 @@ struct filedesc0 {
|
|||||||
NDSLOTTYPE fd_dmap[NDSLOTS(NDFILE)];
|
NDSLOTTYPE fd_dmap[NDSLOTS(NDFILE)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Structure to keep track of (process leader, struct fildedesc) tuples.
|
* Structure to keep track of (process leader, struct fildedesc) tuples.
|
||||||
* Each process has a pointer to such a structure when detailed tracking
|
* Each process has a pointer to such a structure when detailed tracking
|
||||||
@ -131,13 +129,12 @@ struct filedesc_to_leader {
|
|||||||
|
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
|
|
||||||
#define FILEDESC_LOCK_DESC "filedesc structure"
|
|
||||||
|
|
||||||
/* Lock a file descriptor table. */
|
/* Lock a file descriptor table. */
|
||||||
#define FILEDESC_LOCK(fd) mtx_lock(&(fd)->fd_mtx)
|
#define FILEDESC_LOCK(fd) mtx_lock(&(fd)->fd_mtx)
|
||||||
#define FILEDESC_UNLOCK(fd) mtx_unlock(&(fd)->fd_mtx)
|
#define FILEDESC_UNLOCK(fd) mtx_unlock(&(fd)->fd_mtx)
|
||||||
#define FILEDESC_LOCKED(fd) mtx_owned(&(fd)->fd_mtx)
|
#define FILEDESC_LOCKED(fd) mtx_owned(&(fd)->fd_mtx)
|
||||||
#define FILEDESC_LOCK_ASSERT(fd, type) mtx_assert(&(fd)->fd_mtx, (type))
|
#define FILEDESC_LOCK_ASSERT(fd, type) mtx_assert(&(fd)->fd_mtx, (type))
|
||||||
|
#define FILEDESC_LOCK_DESC "filedesc structure"
|
||||||
|
|
||||||
struct thread;
|
struct thread;
|
||||||
|
|
||||||
@ -145,26 +142,23 @@ int closef(struct file *fp, struct thread *p);
|
|||||||
int dupfdopen(struct thread *td, struct filedesc *fdp, int indx, int dfd,
|
int dupfdopen(struct thread *td, struct filedesc *fdp, int indx, int dfd,
|
||||||
int mode, int error);
|
int mode, int error);
|
||||||
int falloc(struct thread *p, struct file **resultfp, int *resultfd);
|
int falloc(struct thread *p, struct file **resultfp, int *resultfd);
|
||||||
void fdused(struct filedesc *fdp, int fd);
|
|
||||||
void fdunused(struct filedesc *fdp, int fd);
|
|
||||||
int fdalloc(struct thread *p, int minfd, int *result);
|
int fdalloc(struct thread *p, int minfd, int *result);
|
||||||
int fdavail(struct thread *td, int n);
|
int fdavail(struct thread *td, int n);
|
||||||
void fdcloseexec(struct thread *td);
|
|
||||||
int fdcheckstd(struct thread *td);
|
int fdcheckstd(struct thread *td);
|
||||||
|
void fdcloseexec(struct thread *td);
|
||||||
struct filedesc *fdcopy(struct filedesc *fdp);
|
struct filedesc *fdcopy(struct filedesc *fdp);
|
||||||
void fdfree(struct thread *td);
|
void fdfree(struct thread *td);
|
||||||
struct filedesc *fdinit(struct filedesc *fdp);
|
struct filedesc *fdinit(struct filedesc *fdp);
|
||||||
struct filedesc *fdshare(struct filedesc *fdp);
|
struct filedesc *fdshare(struct filedesc *fdp);
|
||||||
|
void fdunused(struct filedesc *fdp, int fd);
|
||||||
|
void fdused(struct filedesc *fdp, int fd);
|
||||||
void ffree(struct file *fp);
|
void ffree(struct file *fp);
|
||||||
static __inline struct file * fget_locked(struct filedesc *fdp, int fd);
|
|
||||||
int getvnode(struct filedesc *fdp, int fd, struct file **fpp);
|
|
||||||
void setugidsafety(struct thread *td);
|
|
||||||
|
|
||||||
struct filedesc_to_leader *
|
struct filedesc_to_leader *
|
||||||
filedesc_to_leader_alloc(struct filedesc_to_leader *old,
|
filedesc_to_leader_alloc(struct filedesc_to_leader *old,
|
||||||
struct filedesc *fdp,
|
struct filedesc *fdp,
|
||||||
struct proc *leader);
|
struct proc *leader);
|
||||||
|
int getvnode(struct filedesc *fdp, int fd, struct file **fpp);
|
||||||
|
void setugidsafety(struct thread *td);
|
||||||
|
|
||||||
static __inline struct file *
|
static __inline struct file *
|
||||||
fget_locked(struct filedesc *fdp, int fd)
|
fget_locked(struct filedesc *fdp, int fd)
|
||||||
|
Loading…
Reference in New Issue
Block a user