Skip to content

Undefined constant EIO_O_FSYNC #34

Closed

Description

@valVk

PHP : 7.2.6
EIO: 2.0.3
the code above produce the following output

<?php

$flagMapping = [
  '+' => EIO_O_RDWR,
  'a' => EIO_O_APPEND,
  'c' => EIO_O_CREAT,
  'e' => EIO_O_EXCL,
  'f' => EIO_O_SYNC,
  'n' => EIO_O_NONBLOCK,
  'r' => EIO_O_RDONLY,
  't' => EIO_O_TRUNC,
  'w' => EIO_O_WRONLY,
];
print_r($flagMapping);
 $ docker exec -it react-cli sh -c 'php ./a.php'                                                                                                            [17:56:51]

Warning: Use of undefined constant EIO_O_SYNC - assumed 'EIO_O_SYNC' (this will throw an Error in a future version of PHP) in /var/www/html/a.php on line 8

Call Stack:
    0.0002     387648   1. {main}() /var/www/html/a.php:0

Array
(
    [+] => 2
    [a] => 1024
    [c] => 64
    [e] => 128
    [f] => EIO_O_SYNC
    [n] => 2048
    [r] => 0
    [t] => 512
    [w] => 1
)

List of defined constants for EIO

<?php

print_r(get_defined_constants(true));
...
    [eio] => Array
        (
            [EIO_SEEK_SET] => 0
            [EIO_SEEK_CUR] => 1
            [EIO_SEEK_END] => 2
            [EIO_PRI_MIN] => -4
            [EIO_PRI_DEFAULT] => 0
            [EIO_PRI_MAX] => 4
            [EIO_READDIR_DENTS] => 1
            [EIO_READDIR_DIRS_FIRST] => 2
            [EIO_READDIR_STAT_ORDER] => 4
            [EIO_READDIR_FOUND_UNKNOWN] => 128
            [EIO_DT_UNKNOWN] => 0
            [EIO_DT_FIFO] => 1
            [EIO_DT_CHR] => 2
            [EIO_DT_MPC] => 3
            [EIO_DT_DIR] => 4
            [EIO_DT_NAM] => 5
            [EIO_DT_BLK] => 6
            [EIO_DT_MPB] => 7
            [EIO_DT_REG] => 8
            [EIO_DT_NWK] => 9
            [EIO_DT_CMP] => 9
            [EIO_DT_LNK] => 10
            [EIO_DT_SOCK] => 12
            [EIO_DT_DOOR] => 13
            [EIO_DT_WHT] => 14
            [EIO_DT_MAX] => 15
            [EIO_O_RDONLY] => 0
            [EIO_O_WRONLY] => 1
            [EIO_O_RDWR] => 2
            [EIO_O_NONBLOCK] => 2048
            [EIO_O_APPEND] => 1024
            [EIO_O_CREAT] => 64
            [EIO_O_TRUNC] => 512
            [EIO_O_EXCL] => 128
            [EIO_S_IRUSR] => 256
            [EIO_S_IWUSR] => 128
            [EIO_S_IXUSR] => 64
            [EIO_S_IRGRP] => 32
            [EIO_S_IWGRP] => 16
            [EIO_S_IXGRP] => 8
            [EIO_S_IROTH] => 4
            [EIO_S_IWOTH] => 2
            [EIO_S_IXOTH] => 1
            [EIO_S_IFREG] => 32768
            [EIO_S_IFCHR] => 8192
            [EIO_S_IFBLK] => 24576
            [EIO_S_IFIFO] => 4096
            [EIO_S_IFSOCK] => 49152
            [EIO_SYNC_FILE_RANGE_WAIT_BEFORE] => 1
            [EIO_SYNC_FILE_RANGE_WRITE] => 2
            [EIO_SYNC_FILE_RANGE_WAIT_AFTER] => 4
            [EIO_FALLOC_FL_KEEP_SIZE] => 1
        )
...

What kind of version EIO must be used for this library?

UPD.

https://pecl.php.net/package-changelog.php?package=eio&release=2.0.3


2.0.2 | Fixed build error due to undefined O_FSYNC in musl libc

Activity

  1. valVk commented on Jul 23, 2018

    @valVk
    Author

    @WyriHaximus What do you think about this issue?

  2. WyriHaximus commented on Jul 23, 2018

    @WyriHaximus
    Member

    @valVk I'd 1.0 and 2.0 but this has to be fixed. Either by removing the use of that constant or by adding a polyfill. Not sure yet, leaning torwards the former

  3. valVk commented on Jul 24, 2018

    @valVk
    Author

    Thanks for your clarification.
    I think, that information about EIO's version has to be added to the Readme.

  4. reopened this on Jul 24, 2018
  5. added this to the v0.1.2 milestone on Aug 9, 2018
  6. WyriHaximus commented on Sep 15, 2018

    @WyriHaximus
    Member

    @valVk dropping it in v0.1.2/v0.2 as f isn't supported by PHP either and EIO also dropped it. PR is up at #44

  7. kelunik commented on Apr 20, 2020

    @kelunik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions