@@ -337,6 +337,13 @@ pub const PROT_WRITE: u32 = 1 << 1;
337
337
/// Indicates that the memory region should be executable.
338
338
pub const PROT_EXEC : u32 = 1 << 2 ;
339
339
340
+ /// The file offset is set to offset bytes.
341
+ pub const SEEK_SET : i32 = 0 ;
342
+ /// The file offset is set to its current location plus offset bytes.
343
+ pub const SEEK_CUR : i32 = 1 ;
344
+ /// The file offset is set to the size of the file plus offset bytes.
345
+ pub const SEEK_END : i32 = 2 ;
346
+
340
347
// symbols, which are part of the library operating system
341
348
extern "C" {
342
349
/// Get the last error number from the thread local storage
@@ -718,6 +725,14 @@ extern "C" {
718
725
addrlen : * mut socklen_t ,
719
726
) -> isize ;
720
727
728
+ /// The fseek() function sets the file position indicator for the stream pointed to by stream.
729
+ /// The new position, measured in bytes, is obtained by adding offset bytes to the position
730
+ /// specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is
731
+ /// relative to the start of the file, the current position indicator, or end-of-file,
732
+ /// respectively.
733
+ #[ link_name = "sys_lseek" ]
734
+ pub fn lseek ( fd : i32 , offset : isize , whence : i32 ) -> isize ;
735
+
721
736
/// write to a file descriptor
722
737
///
723
738
/// write() attempts to write `len` of data to the object
0 commit comments