9 main(int argc
, char *argv
[])
18 fd_parent
= atoi(argv
[1]);
20 /* If we open a new file, the fd we obtain should be fd_parent + 1 */
21 fd
= open("open_plusplus_fd", O_CREAT
|O_RDWR
, 0660);
22 if (fd
!= fd_parent
+ 1) {
26 /* Also, writing to fd_parent should succeed */
27 if (write(fd_parent
, buf
, sizeof(buf
)) <= 0) {