Sample Programs
Raw Mode
printf(” dl_errno = 0x%02x\n”,
} else {
printf(”%s,check_ctrl: expected primitive 0x%02x”, tag, prim); printf(”, got primitive 0x%02x\n”,
}
}
}
put_ctrl(fd, len, pri)
int fd, len, pri;
{
ctl.len = len;
if(putmsg(fd, &ctl, 0, pri) < 0) {
printf(”%s,put_ctrl: putmsg failed, errno = %d\n”, tag, errno); exit(1);
}
}
put_both(fd, clen, dlen, pri)
int fd, clen, dlen, pri;
{
ctl.len = clen; dat.len = dlen;
if(putmsg(fd, &ctl, &dat, pri) < 0) {
printf(”%s,put_both: putmsg failed, errno = %d\n”, tag, errno); exit(1);
}
}
int |
|
dl_open(ppa) |
|
int | ppa; |
{ |
|
int | fd; |
dl_attach_req_t *attach_req = (dl_attach_req_t *)ctl_area;
if((fd = open(”/dev/dlpi”, O_RDWR)) ==
}
put_ctrl(fd, sizeof(dl_attach_req_t), 0); get_msg(fd);
check_ctrl(DL_OK_ACK);
Appendix A | 169 |