[haiku-commits] Re: haiku: hrev47024 - src/build/libbe/storage

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 17 Mar 2014 16:33:01 -0400

Jérôme Duval wrote:
2014-03-17 19:04 GMT+01:00 John Scipione<jscipione@xxxxxxxxx>:
This is not right.

B_PATH_NAME_LENGTH is defined as PATH_MAX

According to this:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

{PATH_MAX} Maximum number of bytes in a pathname, including the
terminating null character.


According to hrev24425 commit message [1], _kern_read_link follow the
readlink() specs [2]:
"Conforming applications should not assume that the returned contents
of the symbolic link are null-terminated."
I understand that the specification of PATH_MAX means PATH_MAX minus 1
has to be passed to _kern_read_link as buffer size parameter.

After reading the readlink description that the code seems correct, thanks for 
the explanation and sorry for the noise.

Other related posts: