1N/A * Copyright (c) 2000-2001, 2004 Sendmail, Inc. and its suppliers. 1N/A * All rights reserved. 1N/A * Copyright (c) 1990, 1993 1N/A * The Regents of the University of California. All rights reserved. 1N/A * This code is derived from software contributed to Berkeley by 1N/A * By using this file, you agree to the terms and conditions set 1N/A * forth in the LICENSE file which can be found at the top level of 1N/A * the sendmail distribution. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A** TELLALRM -- handler when timeout activated for sm_io_tell() 1N/A** Returns flow of control to where setjmp(TellTimeOut) was set. 1N/A** returns flow of control to setjmp(TellTimeOut). 1N/A** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD 1N/A** ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE 1N/A** SM_IO_TELL -- position the file pointer 1N/A** fp -- the file pointer to get repositioned 1N/A** timeout -- time to complete the tell (milliseconds) 1N/A** Success -- the repositioned location. 1N/A** Failure -- -1 (minus 1) and sets errno 1N/A ** Filling the buffer will take time and we are wanted to 1N/A ** return immediately. So... 1N/A ** Find offset of underlying I/O object, then adjust byte position 1N/A ** may adjust seek offset on append stream 1N/A /* This is where we start the timeout */ 1N/A /* XXX only set the timeout here? */ 1N/A ** Reading. Any unread characters (including 1N/A ** those from ungetc) cause the position to be 1N/A ** smaller than that in the underlying object. 1N/A ** Writing. Any buffered characters cause the 1N/A ** position to be greater than that in the 1N/A ** underlying object. 1N/A /* We're back. So undo our timeout and handler */