ssize_t sio_putl(long v) /* Put long */ { char s[128]; sio_ltoa(v, s, 10); /* Based on K&R itoa() */ //line:csapp:sioltoa return sio_puts(s); }
/* * Requires: * None. * * Effects: * Prints the long "v" to stdout using only functions that can be safely * called by a signal handler, and returns either the number of characters * printed or -1 if the long could not be printed. */ static ssize_t sio_putl(long v) { char s[128]; sio_ltoa(v, s, 10); return (sio_puts(s)); }