It's UWAweek 1

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 1168 articles.
Currently 1 other person reading this forum.


SVG not supported

Login to reply

👍?
helpful
5:49am Thu 5th Oct, Christopher M.

"Lewei Xu" <23*0*0*8@s*u*e*t*u*a*e*u*a*> wrote:
> ... haha ...
??
> Before I read the post titled Macro Definitions, I was searching up the maximum path names in Linux systems. I stumbled across MAX_PATH which is defined in <limits.h> which is defined to be 4096 bytes. However, for MAX_PATH to be defined, I also had to use #define _POSIX_C_SOURCE 200809L. > > I also found that MAX_PATH was defined in <sys/param.h> and is the same number as MAXPATHLEN. Just a bit confused about what all these are, and the differences between them.
I believe that the reason for 2 such similar constants is their historic origins - MAXPATHLEN originally from the Unix world, and MAX_PATH from the Windows world. I do most of my work on both Linux and macOS, ensuring that my code compiles with minimal reference to its environment. With this, I always just include sys/param.h and use MAXPATHLEN. On Ubuntu 23.04, today, the value is 4096; on macOS 14.0.1 it is 1024.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy