HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Blocking on /dev/null
Operating System - HP-UX
1828355
Members
3772
Online
109976
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2000 07:28 AM
12-07-2000 07:28 AM
Will multiple processes writing to /dev/null block on each other or run as if they had their own copy of the file?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2000 08:11 AM
12-07-2000 08:11 AM
Re: Blocking on /dev/null
Hi Ed,
You can have as many processes as you want writing to (or reading from) /dev/null without blocking, within the kernel limit for maximum processes or files open, of course.
Writing to /dev/null simply discards data, while reading from always returns 0 bytes.
I don't know exactly how this is implemented but I guess that there is a special hook in the kernel code to achieve this.
Dan
You can have as many processes as you want writing to (or reading from) /dev/null without blocking, within the kernel limit for maximum processes or files open, of course.
Writing to /dev/null simply discards data, while reading from always returns 0 bytes.
I don't know exactly how this is implemented but I guess that there is a special hook in the kernel code to achieve this.
Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2000 08:17 AM
12-07-2000 08:17 AM
Solution
Hi Ed,
They won't block as /dev/null isn't a regular file, it's a 'pseudo driver' special file.
Data written to it will be handled by a kernel routine which simply does nothing with it - throws it away.
If you do 'fuser /dev/null' you'll find that many of your server's processes will have /dev/null open.
Regards,
John
They won't block as /dev/null isn't a regular file, it's a 'pseudo driver' special file.
Data written to it will be handled by a kernel routine which simply does nothing with it - throws it away.
If you do 'fuser /dev/null' you'll find that many of your server's processes will have /dev/null open.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2000 11:13 AM
12-07-2000 11:13 AM
Re: Blocking on /dev/null
I don't think /dev/null blocks on read or write. Note that
reading from /dev/null always returns 0 bytes, and NOT
an endless stream of zeroes (which some systems provide
via the special file /dev/zero).
Processes might block on writing to /dev/null if someone
has acquired a lock on it, and the processes honor the lock,
or if someone has acquired an enforced lock on it. /dev/null
should NOT have the enforcement bit set, so the latter case
shouldn't be possible. (The lock enforcement bit is the same
as the setgid bit.)
reading from /dev/null always returns 0 bytes, and NOT
an endless stream of zeroes (which some systems provide
via the special file /dev/zero).
Processes might block on writing to /dev/null if someone
has acquired a lock on it, and the processes honor the lock,
or if someone has acquired an enforced lock on it. /dev/null
should NOT have the enforcement bit set, so the latter case
shouldn't be possible. (The lock enforcement bit is the same
as the setgid bit.)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP