xref: /freebsd/contrib/pjdfstest/tests/open/18.t (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/open/18.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="open returns EWOULDBLOCK when O_NONBLOCK and one of O_SHLOCK or O_EXLOCK is specified and the file is locked"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10[ "${os}" = "FreeBSD" ] || quick_exit
11
12echo "1..6"
13
14n0=`namegen`
15
16expect 0 create ${n0} 0644
17expect 0 open ${n0} O_RDONLY,O_SHLOCK : open ${n0} O_RDONLY,O_SHLOCK,O_NONBLOCK
18expect "EWOULDBLOCK|EAGAIN" open ${n0} O_RDONLY,O_EXLOCK : open ${n0} O_RDONLY,O_EXLOCK,O_NONBLOCK
19expect "EWOULDBLOCK|EAGAIN" open ${n0} O_RDONLY,O_SHLOCK : open ${n0} O_RDONLY,O_EXLOCK,O_NONBLOCK
20expect "EWOULDBLOCK|EAGAIN" open ${n0} O_RDONLY,O_EXLOCK : open ${n0} O_RDONLY,O_SHLOCK,O_NONBLOCK
21expect 0 unlink ${n0}
22