bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

small problem with install on POSIX type Solaris due to O_CLOEXEC used i


From: Dennis Clarke
Subject: small problem with install on POSIX type Solaris due to O_CLOEXEC used in examples fdflags.c
Date: Thu, 7 Feb 2019 00:02:26 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0


Just a minor nit.

The examples file fdflags.c uses flag O_CLOEXEC which of course does not
exist on Solaris or any linux previous to 2.6.23 so of course install
blows up a bit.  Trivial hack solution is I remove fdflags from the
examples install phase and life goes on neatly.

Sure we have :

/*
 * POSIX constants
 */

#define O_ACCMODE       3       /* Mask for file access modes */
#define FD_CLOEXEC      1       /* close on exec flag */

In the /usr/include/sys/fcntl.h and I see in ./include/bash/include/filecntl.h this :

#if !defined (_FILECNTL_H_)
#define _FILECNTL_H_

#include <fcntl.h>

/* Definitions to set file descriptors to close-on-exec, the Posix way. */
#if !defined (FD_CLOEXEC)
#define FD_CLOEXEC     1
#endif

#define FD_NCLOEXEC    0

#define SET_CLOSE_ON_EXEC(fd)  (fcntl ((fd), F_SETFD, FD_CLOEXEC))
#define SET_OPEN_ON_EXEC(fd)   (fcntl ((fd), F_SETFD, FD_NCLOEXEC))

etc etc

Most likely we need a check for the existence of O_CLOEXEC during the
configure stage and then adjust ./examples/loadables/Makefile.in to
remove or skip the example file.

--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional



reply via email to

[Prev in Thread] Current Thread [Next in Thread]