Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Does Posix require any devices? For example, /dev/urandom, /dev/zero or /dev/null?

I suspect not because of non-*nix OSes, but wanted to ask for completeness.

share|improve this question
1  
/dev/null /dev/tty ... and ... maybe that's it. It also requires the /tmp path. I know because I once asked a similar question. Oh, and /dev/console. –  mikeserv Jul 26 at 16:34

1 Answer 1

up vote 4 down vote accepted

POSIX general defines three special files:

  • /dev/tty
  • /dev/console
  • /dev/null

In addition, / and /tmp are also defined by POSIX.

/dev/zero, /dev/urandom or /dev/random are defined in some UNIX-like operating systems. Some operating systems may not define them, or implement with different names.

Note

share|improve this answer
    
I've seen nul and console on Windows, but I don't believe I've ever seen tty. –  jww Jul 26 at 16:51
2  
@noloader: Windows implement only the first version of POSIX standard. See: en.wikipedia.org/wiki/Microsoft_POSIX_subsystem –  cuonglm Jul 26 at 16:53
1  
@noloader Windows's nul and console aren't related to Unix's /dev/null and /dev/console except in some indirect historical way. The names nul and console were inherited from CP/M (which didn't have directories); CP/M/DOS/Windows's nul means the same thing as unix's /dev/null but console under DOS and Windows means a serial port, not the console like on unix systems. If you run an application in Windows's POSIX subsystem (or in another POSIX implementation on top of Windows), you will get /dev/null, /dev/tty and /dev/console. –  Gilles Jul 27 at 21:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.