Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair support for UnixWare 7.x, preliminary modern Mac OS X support #1492

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lkujaw
Copy link

@lkujaw lkujaw commented Aug 15, 2021

  • src/cmd/ss/Makefile: Properly handle sys ownership of /dev/kmem.
  • src/cmd/ss/Mamfile: Regenerate Mamfile.
  • src/lib/libast/features/standards:
  • Add heuristic (u_long availability) for systems that hide rather
    than reveal functionality in the presence of _POSIX_SOURCE, etc.
  • Define _DARWIN_C_SOURCE, like _GNU_SOURCE, to enable the full range
    of definitions on Mac OS X systems.
  • Due to the above, remove MACH (Mac OS X)-specific hack.

CHECKPOINT: The complete AST suite now builds without error on generic
UnixWare 7.1.4.

* src/cmd/ss/Makefile: Properly handle sys ownership of /dev/kmem.
* src/cmd/ss/Mamfile: Regenerate Mamfile.
* src/lib/libast/features/standards:
- Add heuristic (u_long availability) for systems that hide rather
  than reveal functionality in the presence of _POSIX_SOURCE, etc.
- Define _DARWIN_C_SOURCE, like _GNU_SOURCE, to enable the full range
  of definitions on Mac OS X systems.
- Due to the above, remove __MACH__ (Mac OS X)-specific hack.
@McDutchie
Copy link
Contributor

Hi, I'm not sure why you bothered to post a PR here as this repo is inactive and AT&T will ignore it, but I'm glad you did, because the libast bit of this is applicable to ksh 93u+m. :-)

McDutchie added a commit to ksh93/ksh that referenced this pull request Dec 6, 2021
src/lib/libast/features/standards:
- Add heuristic (u_long availability) for systems that hide rather
  than reveal functionality in the presence of _POSIX_SOURCE, etc.
- Define _DARWIN_C_SOURCE, like _GNU_SOURCE, to enable the full
  range of definitions on macOS systems.
- Due to the above, remove MACH (macOS)-specific hack.
- These changes ported from att#1492 -
  thanks to Lev Kujawski (@lkujaw). His PR indicates that this
  fixes the standards macros on UnixWare, too. Therefore, no longer
  exclude UnixWare from standards macros (re: ff70c27).

src/lib/libast/comp/conf.sh:
- Promote the 'op' member in Conf_t (struct Conf_s) from short to
  int. This allows some Darwin/macOS values, now exposed, to fit
  that would otherwise be truncated, namely:
  _CS_DARWIN_USER_CACHE_DIR               65538
  _CS_DARWIN_USER_DIR                     65536
  _CS_DARWIN_USER_TEMP_DIR                65537
  Thus, the following AST getconf values are now correct on macOS:
  $ /opt/ast/bin/getconf | grep ^DARWIN
  DARWIN_USER_CACHE_DIR=/var/folders/nx/(REDACTED)/C/
  DARWIN_USER_DIR=/var/folders/nx/(REDACTED)/0/
  DARWIN_USER_TEMP_DIR=/var/folders/nx/(REDACTED)/T/

src/lib/libast/features/tty:
- Include <sys/ioctl.h> if available. This silences a compiler
  warning in src/lib/libast/misc/procopen.c about an invalid
  implicit declaration of ioctl(2).
McDutchie added a commit to ksh93/ksh that referenced this pull request Dec 6, 2021
src/lib/libast/features/standards:
- Add heuristic (u_long availability) for systems that hide rather
  than reveal functionality in the presence of _POSIX_SOURCE, etc.
- Define _DARWIN_C_SOURCE, like _GNU_SOURCE, to enable the full
  range of definitions on macOS systems.
- Due to the above, remove MACH (macOS)-specific hack.
- These changes ported from att#1492 -
  thanks to Lev Kujawski (@lkujaw). His PR indicates that this
  fixes the standards macros on UnixWare, too. Therefore, no longer
  exclude UnixWare from standards macros (re: ff70c27).

src/lib/libast/comp/conf.sh:
- Promote the 'op' member in Conf_t (struct Conf_s) from short to
  int. This allows some Darwin/macOS values, now exposed, to fit
  that would otherwise be truncated, namely:
  _CS_DARWIN_USER_CACHE_DIR               65538
  _CS_DARWIN_USER_DIR                     65536
  _CS_DARWIN_USER_TEMP_DIR                65537
  Thus, the following AST getconf values are now correct on macOS:
  $ /opt/ast/bin/getconf | grep ^DARWIN
  DARWIN_USER_CACHE_DIR=/var/folders/nx/(REDACTED)/C/
  DARWIN_USER_DIR=/var/folders/nx/(REDACTED)/0/
  DARWIN_USER_TEMP_DIR=/var/folders/nx/(REDACTED)/T/

src/lib/libast/features/tty:
- Include <sys/ioctl.h> if available. This silences a compiler
  warning in src/lib/libast/misc/procopen.c about an invalid
  implicit declaration of ioctl(2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants