lp2status.c for SCO Unix 3.2v4.x

See Also



Hate these ads?



/* lp2status.c */



#include <fcntl.h>
#include <stdio.h>
#include "lp2status.h"



/* cc -o lp2status lp2status.c -lc */









main(int argc,char **argv)
{
char key=' ';
struct lp2 arg; 



int fild=open("/dev/lp2io",O_WRONLY);
while (key != 'Q')
{



ioctl(fild,MAGIC,&arg);



printf("\n\n\n\n");
if (arg.Lpflags & LPEXIST)
    printf(" LPEXIST");
if (arg.Lpflags & SLEEP)
    printf(" SLEEP");
if (arg.Lpflags & LPBUSY)
    printf(" LPBUSY");
if (arg.Lpflags & WAIT)
    printf(" WAIT");
if (arg.Lpflags & TOPEND)
    printf(" TOPEND");
if (arg.Lpflags & EXCLOPEN)
    printf(" EXCLOPEN");
if (arg.Lpflags & OPEN)
     printf(" OPEN");
printf("\n");


ad



printf("1:Change Debug level %d\n",arg.DeBug);
printf("2:Reset Ccount %d\n",arg.Ccount);
printf("3:Reset Icount %d\n",arg.Icount);
printf("4:Reset spindowns %d\n",arg.spindowns);
printf("5:Reset wsleeps %d\n",arg.wsleeps);
printf("6:Change spinloop %d\n",arg.spinloop);
printf("7:Change Low_water %d\n",arg.Low_water);
printf("8:Change Highwater %d\n",arg.Highwater);
printf("9:Change Wait_int %d\n",arg.Wait_int);



printf("Q to exit or number to be changed ");



scanf(" %1c",&key);
key &= 0xff;
if (key == 'Q' || key == 'q')
  break;
if (key < '1' || key > '9')
 continue;
switch (key)
 {
 case '1': printf("\nNew DeBug level %d ",arg.DeBug);
         scanf("%1d",&(arg.DeBug));
         break;
 case '2': arg.Ccount=0;
         break;
 case '3': arg.Icount=0;
         break;
 case '4': arg.spindowns=0;
         break;
 case '5': arg.wsleeps=0;
         break;
 case '6': printf("\nNew spinloop level %d ",arg.spinloop);
         scanf("%3d",&(arg.spinloop));
         break;
 case '7': printf("\nNew Low_water level %d ",arg.Low_water);
         scanf("%3d",&(arg.Low_water));
         break;
 case '8': printf("\nNew Highwater level %d ",arg.Highwater);
         scanf("%3d",&(arg.Highwater));
         break;
 case '9': printf("\nNew Wait_int level %d ",arg.Wait_int);
         scanf("%3d",&(arg.Wait_int));
         break;
 }



ioctl(fild,1+MAGIC,&arg);




}
close(fild);
}




int Wait_int;
};










Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
363758 2,896

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:
       - Code




Unix/Linux Consultants


http://www.vss3.com SCO/Caldera OpenServer, Unixware & Linux. Tarantella & Non-stop Clustering


SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at http://opensystemscomputing.com and www.go2unix.com.


UBB Computer Services Support for Openserver, Unixware and Linux. Windows integration with Unix/Linux servers. Hardware, Backup and Networking issues. Located near Sacramento CA, we provide onsite support throughout Northern CA and Nationwide via remote access. We are a SCO Authorized Partner and a Microlite BackupEdge Certified Reseller.



Twitter
  • Nov 30 20:25
    I have 37,000 words of a 50,000 word project. I'd like to finish it this week..
  • Nov 30 20:05
    My wife made turkey sandwiches with stuffing and cranberry orange relish - I did not want to eat the last bite. Didn't want it to end!




card_image








Change Congress


Related Posts