<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML ><HEAD ><TITLE >Removing an entry</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Linux Kernel Procfs Guide" HREF="book1.html"><LINK REL="UP" TITLE="Managing procfs entries" HREF="c60.html"><LINK REL="PREVIOUS" TITLE="Creating a directory" HREF="x142.html"><LINK REL="NEXT" TITLE="Communicating with userland" HREF="c177.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Linux Kernel Procfs Guide</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="x142.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Managing procfs entries</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="c177.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="AEN155" ></A >Removing an entry</H1 ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN157" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >void <TT CLASS="FUNCTION" >remove_proc_entry</TT ></CODE >(const char* <TT CLASS="PARAMETER" ><I >name</I ></TT >, struct proc_dir_entry* <TT CLASS="PARAMETER" ><I >parent</I ></TT >);</CODE ></P ><P ></P ></DIV ><P > Removes the entry <TT CLASS="PARAMETER" ><I >name</I ></TT > in the directory <TT CLASS="PARAMETER" ><I >parent</I ></TT > from the procfs. Entries are removed by their <I CLASS="EMPHASIS" >name</I >, not by the <SPAN CLASS="STRUCTNAME" >struct proc_dir_entry</SPAN > returned by the various create functions. Note that this function doesn't recursively remove entries. </P ><P > Be sure to free the <TT CLASS="STRUCTFIELD" ><I >data</I ></TT > entry from the <SPAN CLASS="STRUCTNAME" >struct proc_dir_entry</SPAN > before <TT CLASS="FUNCTION" >remove_proc_entry</TT > is called (that is: if there was some <TT CLASS="STRUCTFIELD" ><I >data</I ></TT > allocated, of course). See <A HREF="x257.html" >the Section called <I >A single call back for many files</I > in the chapter called <I >Communicating with userland</I ></A > for more information on using the <TT CLASS="STRUCTFIELD" ><I >data</I ></TT > entry. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="x142.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="c177.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Creating a directory</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="c60.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Communicating with userland</TD ></TR ></TABLE ></DIV ></BODY ></HTML >