Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
3188 ignore the comment in limits.h and define NAME_MAX
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Sam Zaydel <szaydel@racktopsystems.com>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
andy-js authored and rmustacc committed Apr 27, 2017
1 parent 6fdae1b commit 9c0752a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
17 changes: 0 additions & 17 deletions usr/src/cmd/ypcmd/ypsym.h
Expand Up @@ -34,8 +34,6 @@
#ifndef __YPSYM_H
#define __YPSYM_H

#pragma ident "%Z%%M% %I% %E% SMI"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -165,21 +163,6 @@ struct listofnames
};
typedef struct listofnames listofnames;

/*
* XXX- NAME_MAX can't be defined in <limits.h> in a POSIX conformant system
* (under conditions which apply to Sun systems). Removal of this define
* caused yp to break (and only yp!). Hence, NAME_MAX is defined here
* *exactly* as it was in <limits.h>. I suspect this may not be the
* desired value. I suspect the desired value is either:
* - the maxumum name length for any file system type, or
* - should be _POSIX_NAME_MAX which is the minimum-maximum name
* length in a POSIX conformant system (which just happens to
* be 14), or
* - should be gotten by pathconf() or fpathconf().
* XXX- I leave this to the owners of yp!
*/
#define NAME_MAX 14 /* s5 file system maximum name length */

#ifdef __cplusplus
}
#endif
Expand Down
10 changes: 6 additions & 4 deletions usr/src/head/limits.h
Expand Up @@ -21,6 +21,7 @@

/*
* Copyright (c) 2013 Gary Mills
* Copyright 2017 RackTop Systems.
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
Expand Down Expand Up @@ -256,11 +257,12 @@ extern "C" {
* a specific pathname shall be provided by the pathconf() (5.7.1) function.
*
* This is clear that any machine supporting multiple file system types
* and/or a network can not include this define, regardless of protection
* by the _POSIX_SOURCE and _POSIX_C_SOURCE flags.
*
* #define NAME_MAX 14
* and/or a network should not include this define, regardless of protection
* by the _POSIX_SOURCE and _POSIX_C_SOURCE flags. We chose to ignore that
* and provide it anyway for compatibility with other platforms that don't
* follow the spec as precisely as they should. Its usage is discouraged.
*/
#define NAME_MAX 255

#define CHILD_MAX 25 /* max # of processes per user id */
#ifndef OPEN_MAX
Expand Down

0 comments on commit 9c0752a

Please sign in to comment.