Skip to content

Commit

Permalink
sb-posix:read/write should accept size-t length, not int.
Browse files Browse the repository at this point in the history
  • Loading branch information
stassats committed Mar 6, 2017
1 parent b1d13ec commit 1df5faf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions contrib/sb-bsd-sockets/constants.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@

;; for socket-receive
(:type socklen-t "socklen_t")
(:type size-t "size_t")
(:type ssize-t "ssize_t")

#|
;;; stat is nothing to do with sockets, but I keep it around for testing
Expand Down
8 changes: 4 additions & 4 deletions contrib/sb-posix/interface.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@
(open-with-mode pathname flags mode)
(open-without-mode pathname flags))))))
(def #-win32 "open" #+win32 "_open"))
(define-call* "read" int minusp
(fd file-descriptor) (buf (* t)) (count int))
(define-call "rename" int minusp (oldpath filename) (newpath filename))
(define-call* "rmdir" int minusp (pathname filename))
(define-call* "unlink" int minusp (pathname filename))
(define-call #-netbsd "opendir" #+netbsd "_opendir"
(* t) null-alien (pathname filename))
(define-call* "write" int minusp
(fd file-descriptor) (buf (* t)) (count int))
(define-call* "read" ssize-t minusp
(fd file-descriptor) (buf (* t)) (count size-t))
(define-call* "write" ssize-t minusp
(fd file-descriptor) (buf (* t)) (count size-t))

;;; FIXME: to detect errors in readdir errno needs to be set to 0 and
;;; then checked, like it's done in sb-unix:readdir.
Expand Down
2 changes: 1 addition & 1 deletion package-data-list.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ of SBCL which maintained the CMU-CL-style split into two packages.)"
"NULL-ALIEN"
"OFF-T"
"SAP-ALIEN" "SHORT" "SIGNED"
"SIZE-T"
"SIZE-T" "SSIZE-T"
"SLOT" "STRUCT"
"UNDEFINED-ALIEN-ERROR"
"UNLOAD-SHARED-OBJECT"
Expand Down
1 change: 1 addition & 0 deletions tools-for-build/grovel-headers.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ main(int argc, char *argv[])
DEFTYPE("nlink-t", nlink_t);
DEFTYPE("off-t", off_t);
DEFTYPE("size-t", size_t);
DEFTYPE("ssize-t", ssize_t);
DEFTYPE("time-t", time_t);
#if !defined(LISP_FEATURE_OS_PROVIDES_SUSECONDS_T)
/* Similar kludge in sb-posix. */
Expand Down

0 comments on commit 1df5faf

Please sign in to comment.