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

gtp_u_kernel: Support file:open() returning FDesc module=raw_file_io_… #2

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

Conversation

pespin
Copy link

@pespin pespin commented Oct 27, 2023

…list for NSfd

In my erlang OTP-26 environment, the file:open() functions returns the following as FDesc:
"""
{file_descriptor,raw_file_io_list,
{file_descriptor,
prim_file,
#{handle => #Ref<0.114031393.2719088661.121660>,
owner => <0.526.0>,
r_buffer => #Ref<0.114031393.2719088642.121370>,
r_ahead_size => 0}}}
"""

In this case, the OS file descriptor has to be obtained from the inner FDesc structure, in the handle field. Furthermore, the pointer needs to be converted to its integer using the prim_file:get_handle() function, and finally converted to an integer.

…list for NSfd

In my erlang OTP-26 environment, the file:open() functions returns the
following as FDesc:
"""
{file_descriptor,raw_file_io_list,
 {file_descriptor,
  prim_file,
  #{handle => #Ref<0.114031393.2719088661.121660>,
    owner => <0.526.0>,
    r_buffer => #Ref<0.114031393.2719088642.121370>,
    r_ahead_size => 0}}}
"""

In this case, the OS file descriptor has to be obtained from the inner
FDesc structure, in the handle field. Furthermore, the pointer needs to
be converted to its integer using the prim_file:get_handle() function,
and finally converted to an integer.
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.

1 participant