mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Make nfds_t size_t.
This commit is contained in:
parent
248f446089
commit
cf55531aae
3 changed files with 10 additions and 10 deletions
|
@ -117,7 +117,7 @@ int sys_mprotect(const void*, size_t, int);
|
|||
int sys_munmap(void*, size_t);
|
||||
int sys_openat(int, const char*, int, mode_t);
|
||||
int sys_pipe2(int*, int);
|
||||
int sys_ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*);
|
||||
int sys_ppoll(struct pollfd*, size_t, const struct timespec*, const sigset_t*);
|
||||
ssize_t sys_pread(int, void*, size_t, off_t);
|
||||
ssize_t sys_preadv(int, const struct iovec*, int, off_t);
|
||||
int sys_prlimit(pid_t, int, const struct rlimit*, struct rlimit*);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2015.
|
||||
|
||||
This file is part of Sortix.
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
typedef unsigned long int nfds_t;
|
||||
typedef __SIZE_TYPE__ nfds_t;
|
||||
|
||||
struct pollfd
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2014.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2012, 2014, 2015.
|
||||
|
||||
This file is part of Sortix.
|
||||
|
||||
|
@ -146,7 +146,7 @@ PollNode* PollNode::CreateSlave()
|
|||
return slave = new_slave;
|
||||
}
|
||||
|
||||
static struct pollfd* CopyFdsFromUser(struct pollfd* user_fds, nfds_t nfds)
|
||||
static struct pollfd* CopyFdsFromUser(struct pollfd* user_fds, size_t nfds)
|
||||
{
|
||||
size_t size = sizeof(struct pollfd) * nfds;
|
||||
struct pollfd* fds = new struct pollfd[nfds];
|
||||
|
@ -161,7 +161,7 @@ static struct pollfd* CopyFdsFromUser(struct pollfd* user_fds, nfds_t nfds)
|
|||
}
|
||||
|
||||
static bool CopyFdsToUser(struct pollfd* user_fds,
|
||||
const struct pollfd* kernel_fds, nfds_t nfds)
|
||||
const struct pollfd* kernel_fds, size_t nfds)
|
||||
{
|
||||
size_t size = sizeof(struct pollfd) * nfds;
|
||||
return CopyToUser(user_fds, kernel_fds, size);
|
||||
|
@ -177,7 +177,7 @@ static bool FetchTimespec(struct timespec* dest, const struct timespec* user)
|
|||
return true;
|
||||
}
|
||||
|
||||
int sys_ppoll(struct pollfd* user_fds, nfds_t nfds,
|
||||
int sys_ppoll(struct pollfd* user_fds, size_t nfds,
|
||||
const struct timespec* user_timeout_ts,
|
||||
const sigset_t* user_sigmask)
|
||||
{
|
||||
|
@ -208,7 +208,7 @@ int sys_ppoll(struct pollfd* user_fds, nfds_t nfds,
|
|||
volatile bool remote_woken = false;
|
||||
bool unexpected_error = false;
|
||||
|
||||
nfds_t reqs;
|
||||
size_t reqs;
|
||||
for ( reqs = 0; !unexpected_error && reqs < nfds; )
|
||||
{
|
||||
PollNode* node = nodes + reqs;
|
||||
|
@ -252,14 +252,14 @@ int sys_ppoll(struct pollfd* user_fds, nfds_t nfds,
|
|||
|
||||
kthread_mutex_unlock(&wakeup_mutex);
|
||||
|
||||
for ( nfds_t i = 0; i < reqs; i++ )
|
||||
for ( size_t i = 0; i < reqs; i++ )
|
||||
if ( 0 <= fds[i].fd )
|
||||
nodes[i].Cancel();
|
||||
|
||||
if ( !unexpected_error )
|
||||
{
|
||||
int num_events = 0;
|
||||
for ( nfds_t i = 0; i < reqs; i++ )
|
||||
for ( size_t i = 0; i < reqs; i++ )
|
||||
{
|
||||
if ( fds[i].fd < -1 )
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue