Loading...
Searching...
No Matches
lxclock.h
/* SPDX-License-Identifier: LGPL-2.1+ */
#ifndef __LXC_LXCLOCK_H
#define __LXC_LXCLOCK_H
#include "config.h"
#include <fcntl.h>
#include <semaphore.h>
#include <string.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include "compiler.h"
#ifndef F_OFD_GETLK
#define F_OFD_GETLK 36
#endif
#ifndef F_OFD_SETLK
#define F_OFD_SETLK 37
#endif
#ifndef F_OFD_SETLKW
#define F_OFD_SETLKW 38
#endif
#define LXC_LOCK_ANON_SEM 1
#define LXC_LOCK_FLOCK 2
/* private */
struct lxc_lock {
short type;
union {
sem_t *sem;
struct {
int fd;
char *fname;
} f;
} u;
};
__hidden extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name);
__hidden extern int lxclock(struct lxc_lock *lock, int timeout);
__hidden extern int lxcunlock(struct lxc_lock *lock);
__hidden extern void lxc_putlock(struct lxc_lock *lock);
__hidden extern void process_lock(void);
__hidden extern void process_unlock(void);
struct lxc_container;
__hidden extern int container_mem_lock(struct lxc_container *c);
__hidden extern void container_mem_unlock(struct lxc_container *c);
__hidden extern int container_disk_lock(struct lxc_container *c);
__hidden extern void container_disk_unlock(struct lxc_container *c);
#endif
lxc_container
Definition lxccontainer.h:50
lxc_lock
Definition lxclock.h:37
lxc_lock::u
union lxc_lock::@361347236112215107077154123074064024200071366377 u
lxc_lock::f
struct lxc_lock::@361347236112215107077154123074064024200071366377::@041060274225364010230023266323305221104035274016 f
lxc_lock::fd
int fd
Definition lxclock.h:44
lxc_lock::sem
sem_t * sem
Definition lxclock.h:41
lxc_lock::fname
char * fname
Definition lxclock.h:45
lxc_lock::type
short type
Definition lxclock.h:38