tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: CD umount failed
@ 1996-03-25 15:13 Javier Aida
  0 siblings, 0 replies; only message in thread
From: Javier Aida @ 1996-03-25 15:13 UTC (permalink / raw)
  To: tru64-unix-managers

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--

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-03-25 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-25 15:13 SUMMARY: CD umount failed Javier Aida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox