[prev in list] [next in list] [prev in thread] [next in thread]
List: ltp-cvs
Subject: [Ltp-cvs] ltp/lib tst_is_cwd_nfs.c,NONE,1.1
From: Subrata <subrata_modak () users ! sourceforge ! net>
Date: 2007-11-15 8:46:21
Message-ID: E1IsaMg-0001Oj-8k () mail ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/ltp/ltp/lib
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17457/ltp/lib
Added Files:
tst_is_cwd_nfs.c
Log Message:
Add a lib routine to tell us if we are running on NFS, Submitted by Kumar Gala \
<galak@kernel.crashing.org>
--- NEW FILE: tst_is_cwd_nfs.c ---
/******************************************************************************/
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/******************************************************************************/
/*
* AUTHOR
* Kumar Gala <galak@kernel.crashing.org>, 2007-11-14
* based on tst_is_cwd_tmpfs()
*
* DESCRIPTION
* Check if current directory is on a nfs filesystem
* If current directory is nfs, return 1
* If current directory is NOT nfs, return 0
*
*
*/
/******************************************************************************/
#include <sys/vfs.h>
#define NFS_MAGIC 0x6969 /* man 2 statfs */
int
tst_is_cwd_nfs()
{
struct statfs sf;
statfs(".", &sf);
/* Verify that the file is not on a nfs filesystem */
return sf.f_type == NFS_MAGIC?1:0;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ltp-cvs mailing list
Ltp-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic