Changeset View
Changeset View
Standalone View
Standalone View
lib/libcasper/services/cap_fileargs/cap_fileargs.h
Show All 25 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _FILEARGS_H_ | #ifndef _FILEARGS_H_ | ||||
#define _FILEARGS_H_ | #define _FILEARGS_H_ | ||||
#include <sys/cdefs.h> | |||||
#include <sys/dnv.h> | #include <sys/dnv.h> | ||||
#include <sys/nv.h> | #include <sys/nv.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#define FA_OPEN 1 | #define FA_OPEN 1 | ||||
#define FA_LSTAT 2 | #define FA_LSTAT 2 | ||||
#ifdef WITH_CASPER | #ifdef WITH_CASPER | ||||
struct fileargs; | struct fileargs; | ||||
typedef struct fileargs fileargs_t; | typedef struct fileargs fileargs_t; | ||||
struct stat; | struct stat; | ||||
__BEGIN_DECLS | |||||
fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, | fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, | ||||
cap_rights_t *rightsp, int operations); | cap_rights_t *rightsp, int operations); | ||||
fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], | fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], | ||||
int flags, mode_t mode, cap_rights_t *rightsp, int operations); | int flags, mode_t mode, cap_rights_t *rightsp, int operations); | ||||
fileargs_t *fileargs_initnv(nvlist_t *limits); | fileargs_t *fileargs_initnv(nvlist_t *limits); | ||||
fileargs_t *fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits); | fileargs_t *fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits); | ||||
int fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb); | int fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb); | ||||
int fileargs_open(fileargs_t *fa, const char *name); | int fileargs_open(fileargs_t *fa, const char *name); | ||||
void fileargs_free(fileargs_t *fa); | void fileargs_free(fileargs_t *fa); | ||||
FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); | FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); | ||||
fileargs_t *fileargs_wrap(cap_channel_t *chan, int fdflags); | fileargs_t *fileargs_wrap(cap_channel_t *chan, int fdflags); | ||||
cap_channel_t *fileargs_unwrap(fileargs_t *fa, int *fdflags); | cap_channel_t *fileargs_unwrap(fileargs_t *fa, int *fdflags); | ||||
__END_DECLS | |||||
#else | #else | ||||
typedef struct fileargs { | typedef struct fileargs { | ||||
int fa_flags; | int fa_flags; | ||||
mode_t fa_mode; | mode_t fa_mode; | ||||
} fileargs_t; | } fileargs_t; | ||||
static inline fileargs_t * | static inline fileargs_t * | ||||
fileargs_init(int argc __unused, char *argv[] __unused, int flags, mode_t mode, | fileargs_init(int argc __unused, char *argv[] __unused, int flags, mode_t mode, | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |