xref: /freebsd/contrib/pjdfstest/tests/open/16.t (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/open/16.t 219621 2011-03-13 19:35:13Z pjd $
3
4dir=`dirname $0`
5. ${dir}/../misc.sh
6
7case "${os}" in
8Darwin|Linux)
9	error=ELOOP
10	;;
11*)
12	error=EMLINK
13	;;
14esac
15desc="open returns $error when O_NOFOLLOW was specified and the target is a symbolic link"
16
17echo "1..6"
18
19n0=`namegen`
20n1=`namegen`
21
22expect 0 symlink ${n0} ${n1}
23expect $error open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
24expect $error open ${n1} O_RDONLY,O_NOFOLLOW
25expect $error open ${n1} O_WRONLY,O_NOFOLLOW
26expect $error open ${n1} O_RDWR,O_NOFOLLOW
27expect 0 unlink ${n1}
28