From: Javier Aida <jaida () gmd ! com ! pe>
To: tru64-unix-managers
Subject: SUMMARY: CD umount failed
Date: Mon, 25 Mar 1996 15:13:22 +0000 [thread overview]
Message-ID: <96076330121536.tru64-unix-managers.marc@archive.invalid> (raw)
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible. Contact your
mail administrator for information about upgrading your reader to a version
that supports MIME.
------ =_NextPart_000_01BB1A33.B3321A00
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
HI,
Many thnx to=20
fje@buckeye.cb.att.com
Jim Belonis
bouchard_l@decus.fr ( Ooops, just received a blank page from you)
Jim Belonis suggested me to use fuser, a program which allows to see =
which processes are accessing which devices, so i can kill any process =
allocating the CDROM.
fje@buckeye.cb.att.com suggested that i was using two shells, =
unfortunely, that's not the case. I'll try using fuser, and, if someone =
would like to use it, here is the code sent by Jim:
* --------------------------------<Cut =
Here>---------------------------------
*=20
*/
/************************************************************************=
*
** Title : fuser **
** Format : fuser [-f | -c] <file_name|mount_point> **
** file : fuser.c **
** Function: Give the file name/mount poind, PID and user **
** name of the process which has the file opened **
*************************************************************************=
*
*/
#include <stdio.h>
#include <sys/fuser.h>
#include <pwd.h>
#include <unistd.h>
#define File_Owner_Limit 10000
#define Args "fc"
f_user_t File_Owner[File_Owner_Limit];
struct passwd *Owner_Name;
main(int argc, char *argv[])
{
int i,x=3D0;
int c,errflg=3D0;
long Fuser_Type=3DF_FILE_ONLY;
optarg=3DNULL;
while ( !errflg && ( c =3D getopt(argc,argv,Args)) !=3D -1 )
switch (c) {
case 'c' :
Fuser_Type=3DF_CONTAINED;
break;
case 'f' :
Fuser_Type=3DF_FILE_ONLY;
break;
case '?' :
exit(1);
default :
errflg++;
}
if ( (x=3Dfuser(argv[optind],Fuser_Type,File_Owner,(long) sizeof =
(File_Owner))) > 0 )
{
for (i=3D0;i<x;i++) {
Owner_Name=3Dgetpwuid(File_Owner[i].fu_uid);
printf("FILE: %s\tPID: %d\tUSER: =
%s\n",argv[optind],File_Owner[i].fu_pid,Owner_Name->pw_name);
}
}
}
------ =_NextPart_000_01BB1A33.B3321A00--
reply other threads:[~1996-03-25 15:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox