mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
syscalls: isatty
This commit is contained in:
@@ -16,6 +16,7 @@ typedef struct {
|
||||
int (*poll)(int minor, int events);
|
||||
int (*mmap)(int minor, void *addr, uintmax_t offset, int flags);
|
||||
int (*munmap)(int minor, void *addr, uintmax_t offset, int flags);
|
||||
int (*isatty)(int minor);
|
||||
} devops_t;
|
||||
|
||||
typedef struct devnode_t {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <stdint.h>
|
||||
#include <kernel/abi.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef struct {
|
||||
uid_t uid;
|
||||
@@ -90,6 +91,7 @@ typedef struct vops_t {
|
||||
int (*mmap)(vnode_t *node, void *addr, uintmax_t offset, int flags, cred_t *cred);
|
||||
int (*munmap)(vnode_t *node, void *addr, uintmax_t offset, int flags, cred_t *cred);
|
||||
int (*getdents)(vnode_t *node, dent_t *buffer, size_t count, uintmax_t offset, size_t *readcount);
|
||||
int (*isatty)(vnode_t *node);
|
||||
} vops_t;
|
||||
|
||||
#define VFS_MOUNT(vfs, mp, b, d) (vfs)->ops->mount(vfs, mp, b, d)
|
||||
@@ -116,7 +118,8 @@ typedef struct vops_t {
|
||||
#define VOP_MMAP(v, a, o, f, c) (v)->ops->mmap(v, a, o, f, c)
|
||||
#define VOP_MUNMAP(v, a, o, f, c) (v)->ops->munmap(v, a, o, f, c)
|
||||
#define VOP_GETDENTS(v, b, c, o, rc) (v)->ops->getdents(v, b, c, o, rc)
|
||||
#define VOP_POLL(v, p) (v)->ops->poll(v, p);
|
||||
#define VOP_POLL(v, p) (v)->ops->poll(v, p)
|
||||
#define VOP_ISATTY(v) ((v)->ops->isatty ? (v)->ops->isatty(v) : ENOTTY)
|
||||
#define VOP_HOLD(v) __atomic_add_fetch(&(v)->refcount, 1, __ATOMIC_SEQ_CST)
|
||||
#define VOP_RELEASE(v) {\
|
||||
if (__atomic_sub_fetch(&(v)->refcount, 1, __ATOMIC_SEQ_CST) == 0) {\
|
||||
|
||||
Reference in New Issue
Block a user