Changeset 14580
- Timestamp:
- Jan 13, 2011, 10:08:40 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/level-1/l1-streams.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/level-1/l1-streams.lisp
r14522 r14580 3335 3335 (:unicode . :unicode))) 3336 3336 3337 3338 3337 (defun optimal-buffer-size (fd element-type) 3339 3338 #+windows-target (declare (ignore fd)) 3340 (let* (#-windows-target (nominal (or (nth-value 6 (%fstat fd)) *elements-per-buffer*)) 3341 (octets #+windows-target #$BUFSIZ 3342 #-windows-target 3343 (case (%unix-fd-kind fd) 3344 (:pipe (#_fpathconf fd #$_PC_PIPE_BUF)) 3345 (:socket 3346 #+linux-target nominal 3347 #-linux-target 3348 (int-getsockopt fd #$SOL_SOCKET 3349 #+solaris-target #$SO_SNDBUF 3350 #-solaris-target #$SO_SNDLOWAT)) 3351 ((:character-special :tty) (#_fpathconf fd #$_PC_MAX_INPUT)) 3352 (t nominal)))) 3353 (when (<= octets 0) (setq octets nominal)) 3354 (case (subtag-bytes (element-type-subtype element-type) 1) 3355 (1 octets) 3356 (2 (ash octets -1)) 3357 (4 (ash octets -2)) 3358 (8 (ash octets -3))))) 3359 3360 3361 3362 3339 (flet ((scale-buffer-size (octets) 3340 (case (subtag-bytes (element-type-subtype element-type) 1) 3341 (1 octets) 3342 (2 (ash octets -1)) 3343 (4 (ash octets -2)) 3344 (8 (ash octets -3))))) 3345 #+windows-target 3346 (let ((octets #$BUFSIZ)) 3347 (scale-buffer-size octets)) 3348 #-windows-target 3349 (let* ((nominal (or (nth-value 6 (%fstat fd)) *elements-per-buffer*)) 3350 (octets (case (%unix-fd-kind fd) 3351 (:pipe (#_fpathconf fd #$_PC_PIPE_BUF)) 3352 (:socket 3353 #+linux-target nominal 3354 #-linux-target 3355 (int-getsockopt fd #$SOL_SOCKET 3356 #+solaris-target #$SO_SNDBUF 3357 #-solaris-target #$SO_SNDLOWAT)) 3358 ((:character-special :tty) 3359 (#_fpathconf fd #$_PC_MAX_INPUT)) 3360 (t nominal)))) 3361 (when (<= octets 0) (setq octets nominal)) 3362 (scale-buffer-size octets)))) 3363 3363 3364 3364 (defun milliseconds-until-deadline (deadline ioblock)
Note:
See TracChangeset
for help on using the changeset viewer.
