Posix Là Gì

Posix compliance is a standard that is been followed by many a companies.I have sầu few question around this area,1. does all the tệp tin systems need to be posix compliant?2. are applications also required to be posix compliant?3. are there any non posix filesystems?

Bạn đang xem: Posix là gì


Xem thêm: " Will Là Gì ? Cấu Trúc Và Cách Dùng Will Trong Tiếng Anh

In the area of "requires POSIX filesystem semantics" what is typically meant is:

allows hierarchical file names and resolution (., .., ...)supports at least close-to-open semanticsumask/unix permissions, 3 filetimes8bit byte supportsupports atomic renames on same filesystemfsync()/dirfsync() durability gurantee/limitationsupports multi-user protection (resizing tệp tin returns 0 bytes not previous content)rename & delete open files (Windows does not vày that)tệp tin names supporting all bytes beside "/" and

Sometimes it also means symlink/hardliên kết support as well as tệp tin names and 32bit file pointers (minimum). In some cases it is also used to lớn refer specific API features lượt thích fcntl() locking, mmap() or truncate() or AIO.

Xem thêm: Top Game Chơi Cùng Bạn Bè Vui Nhất 2021, Top 10 Tựa Game Co


When I think about POSIX compliance for distributed file systems, I use the general standard that a distributed file system is POSIX compliant if multiple processes running on different nodes see the same behavior as if they were running on the same node using a local tệp tin system. This basically has two implications:

If the system has multiple buffer-caches, it needs khổng lồ ensure cache consistency. Various mechanisms lớn do so include locks và leases. An example of incorrect behavior in this case would be a writer who writes successfully on one node but then a reader on a different node receives old data. Note however that if the writer/reader are independently racing one another that there is no correct defined behavior because they vị not know which operation will occur first. But if they are coordinating with each other via some mechanism lượt thích messaging, then it would be incorrect if the writer completes (especially if it issues a sync call), sends a message to lớn the reader which is successfully received by the reader, & then the reader reads and gets stale data.If data is striped across multiple data servers, reads và writes that span multiple stripes must be atomic.For example, when a reader reads across stripes at the same time as a writer writes across those same stripes, then the reader should either receive all stripes as they were before the write or all stripes as they were after the write. Incorrect behavior would be for the reader lớn receive some old & some new.Contrary khổng lồ the above, this behavior must work correctly even when the writer/reader are racing.

Although my examples were reads/writes to a single tệp tin, correct behavior also includes write/writes lớn a single tệp tin as well as read/writes and write/writes to the hierarchical namespace via calls such as stat/readdir/mkdir/unlink/etc.