php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70214 Compilation fails, FASYNC not defined, needs sys/file.h include
Submitted: 2015-08-08 11:03 UTC Modified: -
From: rainer dot jung at kippdata dot de Assigned:
Status: Closed Package: phpdbg
PHP Version: 7.0.0beta3 OS: Solaris 10 Sparc
Private report: No CVE-ID: None
 [2015-08-08 11:03 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-08 13:53 UTC] bwoebi@php.net
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)
 [2015-08-08 13:53 UTC] bwoebi@php.net
-Status: Open +Status: Closed
 [2015-08-18 16:24 UTC] ab@php.net
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)
 [2016-07-20 11:37 UTC] davey@php.net
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)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC