View Single Post
Old 26th May 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Quote:
Originally Posted by TerryP View Post
My point being. mkdir() is an OS specific system call -- both its presence, system call number, calling convention, behaviour, and above all..... What says that your code is running on a computer that has access to a file system in the first place, let along that said file system must implement the directories concept at all ;-). Directories/Folders are a universally simple and in the modern world, very a portable concept. Actually doing anything fun with them is non portable, and likely to be extremely so if you want to write portable code - because it might just find itself on a directory less file system, let along a mkdir()'less environment. This is why perl mkdir() or python os.mkdir() are fairly portable for unix/windows/most os, but doing it in C is not as much fun.
No system calls are standardized, they different between all operating systems.. that's why a common set of high level libraries are provided that comply with standards.

mkdir(2) on OpenBSD is just a wrapper to the mkdir system call.. but it doesn't have to be, mkdir(2) is now standardized.. how it works behind the scenes is implementation specific, it could call upon the cosmic forces to align the stars in a way that represents a new hierarchal level. (..if you were crazy enough to mess around with such dangerous yet imaginary forces.)

http://www.opengroup.org/onlinepubs/...ons/mkdir.html

If the operating system you're attempting to port to has no concept of a file system, it will be extremely hard for them to be POSIX/SUS compliant..

In the end it depends on your definition of portable, can you write a game that works on every OS in existence? probably not.. it wouldn't be incredibly useful on the embedded trimmed down OS on a craft orbiting Pluto, so consider limiting your target to a specific type of operating system.. many exist that have similar environments and share a common set of operations.

Xorg is a reference implementation of X11 for POSIX compatible systems, but sometimes 3rd parties painstakingly try to port it to non-POSIX systems.

Last edited by BSDfan666; 26th May 2009 at 02:47 PM.
Reply With Quote