2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/mknod/11.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="mknod creates device files"
22 expect 0 mkdir ${n1} 0755
36 # Create char special with old-style numbers
37 expect 0 mknod ${n0} ${type} 0755 1 2
38 expect ${stattype},0755 lstat ${n0} type,mode
39 expect 1,2 lstat ${n0} major,minor
40 expect EEXIST mknod ${n0} ${type} 0777 3 4
45 # Create char special with new-style numbers
46 expect 0 mknod ${n0} ${type} 0755 4095 4095
47 expect ${stattype},0755 lstat ${n0} type,mode
48 expect 4095,4095 lstat ${n0} major,minor
49 expect EEXIST mknod ${n0} ${type} 0777 4000 4000
52 # mknod returns EINVAL if device's numbers are too big
53 # for 32-bit solaris !!
54 expect EINVAL mknod ${n0} ${type} 0755 4096 262144
58 # POSIX: Upon successful completion, mknod(2) shall mark for update the
59 # st_atime, st_ctime, and st_mtime fields of the file. Also, the st_ctime and
60 # st_mtime fields of the directory that contains the new entry shall be marked
63 time=`${fstest} stat . ctime`
65 expect 0 mknod ${n0} ${type} 0755 1 2
66 atime=`${fstest} stat ${n0} atime`
67 test_check $time -lt $atime
68 mtime=`${fstest} stat ${n0} mtime`
69 test_check $time -lt $mtime
70 ctime=`${fstest} stat ${n0} ctime`
71 test_check $time -lt $ctime
72 mtime=`${fstest} stat . mtime`
73 test_check $time -lt $mtime
74 ctime=`${fstest} stat . ctime`
75 test_check $time -lt $ctime