Re: syscalls: Add epoll_create03

Cyril Hrubis <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi!
> --- [PATCH 7/9] ---
> 
> > 	rval = poll(fds, nfds, timeout);
> > 	if (rval == -1) {
> > 		tst_brk_(file, lineno, TBROK | TERRNO,
> > 			"poll(%p, %li, %i) failed", fds, (long)nfds, timeout);
> > 	} else if (rval < -1) {
> > 		tst_brk_(file, lineno, TBROK | TERRNO,
> > 			"Invalid poll(%p, %li, %i) return value %i",
> > 			fds, (long)nfds, timeout, rval);
> > 	}
> 
> poll() returns -1 on error or >= 0 on success; it cannot return a
> value less than -1. The else-if branch is dead code.
> 
> The nearby safe_statvfs() uses "else if (rval)" to catch unexpected
> non-zero returns for a function that is 0 on success. poll() returns
> 0 (timeout) and positive values (events ready) as normal outcomes, so
> no such secondary check applies here. The body should just have the
> rval == -1 guard and return rval.

I will ignore this one since we are guarding againts kernel bugs with
this code. I.e. if kernel returns impossible value we want the test to
report it.

-- 
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.