Bug #70214 [Opn->Csd]: Compilation fails, FASYNC not defined, needs sys/file.h include

From: Date: Sat, 08 Aug 2015 13:53:37 +0000
Subject: Bug #70214 [Opn->Csd]: Compilation fails, FASYNC not defined, needs sys/file.h include
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195024@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70214&edit=1

 ID:                 70214
 Updated by:         bwoebi@php.net
 Reported by:        rainer dot jung at kippdata dot de
 Summary:            Compilation fails, FASYNC not defined, needs
                     sys/file.h include
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            phpdbg
 Operating System:   Solaris 10 Sparc
 PHP Version:        7.0.0beta3
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0c60524190b15fbc583db44b8cb4e3fddac9549c
Log: Fixed bug #70214 (FASYNC possibly not defined)


Previous Comments:
------------------------------------------------------------------------
[2015-08-08 11:03:01] rainer dot jung at kippdata dot de

Description:
------------
Compilation of phpdbg on Solaris 10 Sparc fails:

.../sapi/phpdbg/phpdbg_utils.c: In function 'phpdbg_set_async_io':
.../sapi/phpdbg/phpdbg_utils.c:353:39: error: 'FASYNC' undeclared (first use in this
function)
  fcntl(STDIN_FILENO, F_SETFL, flags | FASYNC);

On Solaris FASYNC is defined in sys/file.h:

...
/* open-only modes */

#define FCREAT          0x0100
#define FTRUNC          0x0200
#define FEXCL           0x0400
#define FNOCTTY         0x0800
#define FXATTR          0x4000  /* open as extended attribute */

#define FASYNC          0x1000  /* asyncio in progress pseudo flag */
#define FNODSYNC        0x10000 /* fsync pseudo flag */

#define FNOFOLLOW       0x20000 /* don't follow symlinks */
#define FNOLINKS        0x40000 /* don't allow multiple hard links */
...

As a workaround I added "#include <sys/file.h>" to phpdbg.h.

I think you need to use auto foo to detect existence of FASYNC and if not present check again with
using sys/file.h to decide, whether you need to include it. This is unfortunately outside of POSIX
et. al., so platform specific.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=70214&edit=1


Thread (2 messages)

« previous php.bugs (#195024) next »