Skip to content

Commit

Permalink
file: set offset argument for io_uring_prep_read as optional.
Browse files Browse the repository at this point in the history
- minor type and bool fixes.
  • Loading branch information
YoSTEALTH committed May 2, 2024
1 parent 503aaeb commit 5b73344
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def build_extensions(self):
copy2(src, join(tmpdir, src))

# note: just runs `configure` & `make`, does not `install`.
sub_process_run(['./configure'], cwd=lib, capture_output=False, check=True)
sub_process_run(['make', f'--jobs={threads}'], cwd=lib, capture_output=False)
sub_process_run(['./configure'], cwd=lib, capture_output=True, check=True)
sub_process_run(['make', f'--jobs={threads}'], cwd=lib, capture_output=True)

# replace `include` placeholder files with actual content.
copytree(libinc, 'src/liburing/include', dirs_exist_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion src/liburing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dynamic_import import importer


__version__ = '2024.4.24'
__version__ = '2024.5.2'


importer(exclude_dir=['lib', 'include'])
Expand Down
1 change: 0 additions & 1 deletion src/liburing/common.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from posix.unistd cimport _SC_IOV_MAX
from cpython.mem cimport PyMem_RawCalloc, PyMem_RawFree
from libc.string cimport strlen
from .lib.uring cimport *
from .error cimport memory_error, index_error
from .queue cimport io_uring_sqe
Expand Down
2 changes: 1 addition & 1 deletion src/liburing/file.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cpdef void io_uring_prep_read(io_uring_sqe sqe,
int fd,
unsigned char[:] buf, # `void *buf`
unsigned int nbytes,
__u64 offset) noexcept nogil
__u64 offset=?) noexcept nogil
cpdef void io_uring_prep_read_multishot(io_uring_sqe sqe,
int fd,
unsigned int nbytes,
Expand Down
2 changes: 1 addition & 1 deletion src/liburing/file.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ cpdef inline void io_uring_prep_read(io_uring_sqe sqe,
int fd,
unsigned char[:] buf, # `void *buf`
unsigned int nbytes,
__u64 offset) noexcept nogil:
__u64 offset=0) noexcept nogil:
__io_uring_prep_read(sqe.ptr, fd, &buf[0], nbytes, offset)

cpdef inline void io_uring_prep_read_multishot(io_uring_sqe sqe,
Expand Down
4 changes: 2 additions & 2 deletions src/liburing/queue.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ cdef class io_uring_sqe:
index_error(self, index, 'out of `sqe`')
@property
def flags(self) -> __u8:
def flags(self) -> unsigned:
return self.ptr.flags
@flags.setter
def flags(self, __u8 flags):
def flags(self, unsigned int flags):
__io_uring_sqe_set_flags(self.ptr, flags)
@property
Expand Down

0 comments on commit 5b73344

Please sign in to comment.