File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ addToLibrary({
20
20
// refcnt 2 because pipe has a read end and a write end. We need to be
21
21
// able to read from the read end after write end is closed.
22
22
refcnt : 2 ,
23
+ timestamp : new Date ( ) ,
23
24
} ;
24
25
25
26
pipe . buckets . push ( {
@@ -60,6 +61,25 @@ addToLibrary({
60
61
} ;
61
62
} ,
62
63
stream_ops : {
64
+ getattr ( stream ) {
65
+ var node = stream . node ;
66
+ var timestamp = node . pipe . timestamp ;
67
+ return {
68
+ dev : 14 ,
69
+ ino : node . id ,
70
+ mode : 0o10600 ,
71
+ nlink : 1 ,
72
+ uid : 0 ,
73
+ gid : 0 ,
74
+ rdev : 0 ,
75
+ size : 0 ,
76
+ atime : timestamp ,
77
+ mtime : timestamp ,
78
+ ctime : timestamp ,
79
+ blksize : 4096 ,
80
+ blocks : 0 ,
81
+ } ;
82
+ } ,
63
83
poll ( stream ) {
64
84
var pipe = stream . node . pipe ;
65
85
Original file line number Diff line number Diff line change 7
7
8
8
#include <unistd.h>
9
9
#include <sys/types.h>
10
+ #include <sys/stat.h>
10
11
#include <fcntl.h>
11
12
#include <poll.h>
12
13
#include <errno.h>
@@ -65,6 +66,10 @@ int test_most() {
65
66
66
67
assert (pipe (fd ) == 0 );
67
68
69
+ // Test that pipe is statable
70
+ struct stat st ;
71
+ assert (fstat (fd [0 ], & st ) == 0 );
72
+
68
73
// Test that pipe is not seekable
69
74
70
75
memset (buf , 0 , sizeof buf );
You can’t perform that action at this time.
0 commit comments