1<html lang="en"> 2<head> 3<title>write - Debugging with GDB</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Debugging with GDB"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="List-of-Supported-Calls.html#List-of-Supported-Calls" title="List of Supported Calls"> 9<link rel="prev" href="read.html#read" title="read"> 10<link rel="next" href="lseek.html#lseek" title="lseek"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 141998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 15Free Software Foundation, Inc. 16 17Permission is granted to copy, distribute and/or modify this document 18under the terms of the GNU Free Documentation License, Version 1.3 or 19any later version published by the Free Software Foundation; with the 20Invariant Sections being ``Free Software'' and ``Free Software Needs 21Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 22and with the Back-Cover Texts as in (a) below. 23 24(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 25this GNU Manual. Buying copies from GNU Press supports the FSF in 26developing GNU and promoting software freedom.''--> 27<meta http-equiv="Content-Style-Type" content="text/css"> 28<style type="text/css"><!-- 29 pre.display { font-family:inherit } 30 pre.format { font-family:inherit } 31 pre.smalldisplay { font-family:inherit; font-size:smaller } 32 pre.smallformat { font-family:inherit; font-size:smaller } 33 pre.smallexample { font-size:smaller } 34 pre.smalllisp { font-size:smaller } 35 span.sc { font-variant:small-caps } 36 span.roman { font-family:serif; font-weight:normal; } 37 span.sansserif { font-family:sans-serif; font-weight:normal; } 38--></style> 39<link rel="stylesheet" type="text/css" href="../cs.css"> 40</head> 41<body> 42<div class="node"> 43<a name="write"></a> 44<p> 45Next: <a rel="next" accesskey="n" href="lseek.html#lseek">lseek</a>, 46Previous: <a rel="previous" accesskey="p" href="read.html#read">read</a>, 47Up: <a rel="up" accesskey="u" href="List-of-Supported-Calls.html#List-of-Supported-Calls">List of Supported Calls</a> 48<hr> 49</div> 50 51<h5 class="unnumberedsubsubsec">write</h5> 52 53<p><a name="index-write_002c-file_002di_002fo-system-call-2507"></a> 54 <dl> 55<dt>Synopsis:<dd> 56 <pre class="smallexample"> int write(int fd, const void *buf, unsigned int count); 57</pre> 58 <br><dt>Request:<dd>‘<samp><span class="samp">Fwrite,</span><var>fd</var><span class="samp">,</span><var>bufptr</var><span class="samp">,</span><var>count</var></samp>’ 59 60 <br><dt>Return value:<dd>On success, the number of bytes written are returned. 61Zero indicates nothing was written. On error, -1 62is returned. 63 64 <br><dt>Errors:<dd> 65 <dl> 66<dt><code>EBADF</code><dd><var>fd</var> is not a valid file descriptor or is not open for 67writing. 68 69 <br><dt><code>EFAULT</code><dd><var>bufptr</var> is an invalid pointer value. 70 71 <br><dt><code>EFBIG</code><dd>An attempt was made to write a file that exceeds the 72host-specific maximum file size allowed. 73 74 <br><dt><code>ENOSPC</code><dd>No space on device to write the data. 75 76 <br><dt><code>EINTR</code><dd>The call was interrupted by the user. 77</dl> 78 79 </dl> 80 81 </body></html> 82 83