C语言函数—ioctl

函数名

intr

功 能

改变软中断接口

用 法

void intr(int intr_num, struct REGPACK *preg);

程序例

#include <stdio.h> 
#include <string.h> 
#include <dir.h> 
#include <dos.h> 

#define CF 1  /* Carry flag */ 

int main(void) 
{ 
   char directory[80]; 
   struct REGPACK reg; 

   printf("Enter directory to change to: "); 
   gets(directory); 
   reg.r_ax = 0x3B << 8;         /* shift 3Bh into  AH */ 
   reg.r_dx = FP_OFF(directory); 
   reg.r_ds = FP_SEG(directory); 
   intr(0x21, ®); 
   if (reg.r_flags & CF) 
      printf("Directory change failedn"); 
   getcwd(directory, 80); 
   printf("The current directory is: %sn", directory); 
   return 0; 
} 
  
  

如果引用本站的原创文章,请注明原文链接:,本站保留追究责任的权利!
评论已关闭。