PreviousUpNext

14.3.6  Posix_Io

The standard library Posix_Io api is a sub-API of the Posixlib api.

The above information is manually maintained and may contain errors.

api {    eqtype File_Descriptor ;
    eqtype Process_Id ;
    make_pipe : Void -> {infd:File_Descriptor,  outfd:File_Descriptor};
    make_pipe__without_syscall_redirection : Void -> {infd:File_Descriptor,  outfd:File_Descriptor};
    dup : File_Descriptor -> File_Descriptor;
    dup2 : {new:File_Descriptor,  old:File_Descriptor} -> Void;
    dup2__without_syscall_redirection : {new:File_Descriptor,  old:File_Descriptor} -> Void;
    close : File_Descriptor -> Void;
    close__without_syscall_redirection : File_Descriptor -> Void;
    copy_file : {from:String,  to:String} -> Int;
    file_contents_are_identical : (String , String) -> Bool;
    read_as_vector : {file_descriptor:File_Descriptor, 
                      max_bytes_to_read:Int}
                     -> vector_of_one_byte_unts::Vector;
    read_into_buffer : {file_descriptor:File_Descriptor, 
                        read_buffer:rw_vector_slice_of_one_byte_unts::Slice}
                       -> Int;
    write_string : (File_Descriptor , String) -> Int;
    write_vector : (File_Descriptor , vector_slice_of_one_byte_unts::Slice)
                   -> Int;
    write_rw_vector : (File_Descriptor , rw_vector_slice_of_one_byte_unts::Slice)
                      -> Int;
    read_as_vector__without_syscall_redirection : {file_descriptor:File_Descriptor, 
                                                   max_bytes_to_read:Int}
                                                  -> vector_of_one_byte_unts::Vector;
    read_into_buffer__without_syscall_redirection : {file_descriptor:File_Descriptor, 
                                                     read_buffer:rw_vector_slice_of_one_byte_unts::Slice}
                                                    -> Int;
    write_vector__without_syscall_redirection : (File_Descriptor , vector_slice_of_one_byte_unts::Slice)
                                                -> Int;
    write_rw_vector__without_syscall_redirection : (File_Descriptor , rw_vector_slice_of_one_byte_unts::Slice)
                                                   -> Int;
    Whence  = SEEK_CUR | SEEK_END | SEEK_SET;
    package fd : api {
                     eqtype Flags ;
                     to_unt : Flags -> one_word_unt::Unt;
                     from_unt : one_word_unt::Unt -> Flags;
                     all : Flags;
                     flags : List(Flags ) -> Flags;
                     intersect : List(Flags ) -> Flags;
                     clear : (Flags , Flags) -> Flags;
                     all_set : (Flags , Flags) -> Bool;
                     any_set : (Flags , Flags) -> Bool;
                     cloexec : Flags;
                 };;
    package flags : api {
                        eqtype Flags ;
                        to_unt : Flags -> one_word_unt::Unt;
                        from_unt : one_word_unt::Unt -> Flags;
                        all : Flags;
                        flags : List(Flags ) -> Flags;
                        intersect : List(Flags ) -> Flags;
                        clear : (Flags , Flags) -> Flags;
                        all_set : (Flags , Flags) -> Bool;
                        any_set : (Flags , Flags) -> Bool;
                        append : Flags;
                        nonblock : Flags;
                        sync : Flags;
                        rsync : Flags;
                        dsync : Flags;
                    };;
    dupfd : {base:File_Descriptor,  old:File_Descriptor}
            -> File_Descriptor;
    getfd : File_Descriptor -> fd::Flags;
    setfd : (File_Descriptor , fd::Flags) -> Void;
    setfd__without_syscall_redirection : (File_Descriptor , fd::Flags) -> Void;
    getfl : File_Descriptor
            -> (flags::Flags , ?.posix_common::Open_Mode);
    setfl : (File_Descriptor , flags::Flags) -> Void;
    lseek : (File_Descriptor , Int , Whence) -> Int;
    fsync : File_Descriptor -> Void;
    Lock_Type  = F_RDLCK | F_UNLCK | F_WRLCK;
    package flock : api {
                        Flock ;
                        flock : {len:Int,  locktype:Lock_Type, 
                                 pid:Null_Or(Process_Id ),  start:Int, 
                                 whence:Whence}
                                -> Flock;
                        locktype : Flock -> Lock_Type;
                        whence : Flock -> Whence;
                        start : Flock -> Int;
                        len : Flock -> Int;
                        pid : Flock -> Null_Or(Process_Id );
                    };;
    getlk : (File_Descriptor , flock::Flock) -> flock::Flock;
    setlk : (File_Descriptor , flock::Flock) -> flock::Flock;
    setlkw : (File_Descriptor , flock::Flock) -> flock::Flock;
    make_data_filereader : {file_descriptor:File_Descriptor,  filename:String, 
                            ok_to_block:Bool}
                           -> winix_base_data_file_io_driver_for_posix__premicrothread::Filereader;
    make_text_filereader : {file_descriptor:File_Descriptor,  filename:String, 
                            ok_to_block:Bool}
                           -> winix_base_text_file_io_driver_for_posix__premicrothread::Filereader;
    make_data_filewriter : {append_mode:Bool,  best_io_quantum:Int, 
                            file_descriptor:File_Descriptor,  filename:String, 
                            ok_to_block:Bool}
                           -> winix_base_data_file_io_driver_for_posix__premicrothread::Filewriter;
    make_text_filewriter : {append_mode:Bool,  best_io_quantum:Int, 
                            file_descriptor:File_Descriptor,  filename:String, 
                            ok_to_block:Bool}
                           -> winix_base_text_file_io_driver_for_posix__premicrothread::Filewriter;
    Sy_Int  = Int;
    Sy_Unt  = one_word_unt::Unt;
    osval2__syscall : String -> Sy_Int;
    set__osval2__ref : ({fun_name:String,  io_call:String -> Sy_Int, 
                         lib_name:String}
                        -> String -> Sy_Int) -> Void;
    make_pipe__syscall : Void -> (Sy_Int , Sy_Int);
    set__make_pipe__ref : ({fun_name:String, 
                            io_call:Void -> (Sy_Int , Sy_Int),  lib_name:String}
                           -> Void -> (Sy_Int , Sy_Int)) -> Void;
    dup__syscall : Sy_Int -> Sy_Int;
    set__dup__ref : ({fun_name:String,  io_call:Sy_Int -> Sy_Int, 
                      lib_name:String}
                     -> Sy_Int -> Sy_Int) -> Void;
    dup2__syscall : (Sy_Int , Sy_Int) -> Void;
    set__dup2__ref : ({fun_name:String, 
                       io_call:(Sy_Int , Sy_Int) -> Void,  lib_name:String}
                      -> (Sy_Int , Sy_Int) -> Void) -> Void;
    close__syscall : Sy_Int -> Void;
    set__close__ref : ({fun_name:String,  io_call:Sy_Int -> Void, 
                        lib_name:String}
                       -> Sy_Int -> Void) -> Void;
    read__syscall : (Int , Int) -> vector_of_one_byte_unts::Vector;
    set__read__ref : ({fun_name:String, 
                       io_call:(Int , Int) -> vector_of_one_byte_unts::Vector, 
                       lib_name:String}
                      -> (Int , Int) -> vector_of_one_byte_unts::Vector)
                     -> Void;
    readbuf__syscall : (Int , rw_vector_of_one_byte_unts::Rw_Vector , Int
                        , Int)
                       -> Int;
    set__readbuf__ref : ({fun_name:String,  io_call:(Int , rw_vector_of_one_byte_unts::Rw_Vector , Int
                                                     , Int)
                                                    -> Int,  lib_name:String}
                         -> (Int , rw_vector_of_one_byte_unts::Rw_Vector , Int
                             , Int)
                            -> Int) -> Void;
    write_ro_slice__syscall : (Int , vector_of_one_byte_unts::Vector , Int , Int)
                              -> Int;
    set__write_ro_slice__ref : ({fun_name:String,  io_call:(Int , vector_of_one_byte_unts::Vector , Int , Int)
                                                           -> Int,  lib_name:String}
                                -> (Int , vector_of_one_byte_unts::Vector , Int , Int)
                                   -> Int) -> Void;
    write_rw_slice__syscall : (Int , rw_vector_of_one_byte_unts::Rw_Vector , Int
                               , Int)
                              -> Int;
    set__write_rw_slice__ref : ({fun_name:String,  io_call:(Int , rw_vector_of_one_byte_unts::Rw_Vector , Int
                                                            , Int)
                                                           -> Int,  lib_name:String}
                                -> (Int , rw_vector_of_one_byte_unts::Rw_Vector , Int
                                    , Int)
                                   -> Int) -> Void;
    fcntl_d__syscall : (Sy_Int , Sy_Int) -> Sy_Int;
    set__fcntl_d__ref : ({fun_name:String, 
                          io_call:(Sy_Int , Sy_Int) -> Sy_Int, 
                          lib_name:String}
                         -> (Sy_Int , Sy_Int) -> Sy_Int) -> Void;
    fcntl_gfd__syscall : Sy_Int -> Sy_Unt;
    set__fcntl_gfd__ref : ({fun_name:String,  io_call:Sy_Int -> Sy_Unt, 
                            lib_name:String}
                           -> Sy_Int -> Sy_Unt) -> Void;
    fcntl_sfd__syscall : (Sy_Int , Sy_Unt) -> Void;
    set__fcntl_sfd__ref : ({fun_name:String, 
                            io_call:(Sy_Int , Sy_Unt) -> Void,  lib_name:String}
                           -> (Sy_Int , Sy_Unt) -> Void) -> Void;
    fcntl_gfl__syscall : Sy_Int -> (Sy_Unt , Sy_Unt);
    set__fcntl_gfl__ref : ({fun_name:String, 
                            io_call:Sy_Int -> (Sy_Unt , Sy_Unt), 
                            lib_name:String}
                           -> Sy_Int -> (Sy_Unt , Sy_Unt)) -> Void;
    fcntl_sfl__syscall : (Sy_Int , Sy_Unt) -> Void;
    set__fcntl_sfl__ref : ({fun_name:String, 
                            io_call:(Sy_Int , Sy_Unt) -> Void,  lib_name:String}
                           -> (Sy_Int , Sy_Unt) -> Void) -> Void;
    Flock_Rep  =
      (Sy_Int , Sy_Int , Int , Int , Sy_Int);
    fcntl_l__syscall : (Sy_Int , Sy_Int , Flock_Rep) -> Flock_Rep;
    set__fcntl_l__ref : ({fun_name:String, 
                          io_call:(Sy_Int , Sy_Int , Flock_Rep) -> Flock_Rep, 
                          lib_name:String}
                         -> (Sy_Int , Sy_Int , Flock_Rep) -> Flock_Rep)
                        -> Void;
    lseek__syscall : (Sy_Int , Int , Sy_Int) -> Int;
    set__lseek__ref : ({fun_name:String, 
                        io_call:(Sy_Int , Int , Sy_Int) -> Int, 
                        lib_name:String}
                       -> (Sy_Int , Int , Sy_Int) -> Int) -> Void;
    fsync__syscall : Sy_Int -> Void;
    set__fsync__ref : ({fun_name:String,  io_call:Sy_Int -> Void, 
                        lib_name:String}
                       -> Sy_Int -> Void) -> Void;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext