1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>NANDSimpleSafeClose</title> 9</head> 10 11<body> 12 13<h1>NANDSimpleSafeClose</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/nand.h> 18 19s32 NANDSimpleSafeClose(NANDFileInfo *info); 20</code></pre></dd></dl> 21 22<h2>Arguments</h2> 23<p> 24<TABLE border="1" > 25 <tr> 26<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>info</EM></STRONG></CODE></TD> 27<TD width="520">Pointer to the <CODE>NANDFileInfo</CODE> structure (opened by <CODE>NANDSimpleSafeOpen[Async]</CODE>).</TD> 28 </tr> 29</TABLE> 30</p> 31 32 33<h2>Return Values</h2> 34<p> 35Returns one of the following codes: 36</p> 37 38<p> 39<code>NAND_RESULT_OK<br> NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_CORRUPT<br> NAND_RESULT_INVALID<br> NAND_RESULT_OPENFD<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code> 40</p> 41 42<p> 43<strong>Note:</strong> Depending on the state of internal operations, this function may potentially return <code>NAND_RESULT_OPENFD</code>. <code>NAND_RESULT_OPENFD</code> is not returned as long as there are no illegal operations, such as the application program attempting to directly access the data below <code>/tmp/sys</code> used by the NANDSimpleSafe functions. 44</p> 45 46<h2>Description</h2> 47<p> 48Closes a file in a manner that guarantees the atomic nature of file updates. Files closed using this function must have been opened using <code><a href="./NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a></code> or <code><a href="./NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a></code>. Appropriate permissions (both read and write) must be set for the parent directory of the file where the NANDSimpleSafe type of function is applied. 49</p> 50 51<p> 52This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>. 53</p> 54 55<h2>See Also</h2> 56<p> 57<code><a href="./NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a></code>, <code><a href="./NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a></code>, <code><a href="./NANDSimpleSafeCloseAsync.html">NANDSimpleSafeCloseAsync</a></code>, <code><a href="./NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a></code>, <code><a href="./NANDSimpleSafeCancelAsync.html">NANDSimpleSafeCancelAsync</a></code>, <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 58</p> 59 60<h2>Revision History</h2> 61<p> 622007/09/25 Added information on the sleep status of threads.<br>2007/05/09 Initial version. <BR> 63</p> 64 65<hr><p>CONFIDENTIAL</p></body> 66</html> 67