Lines Matching refs:mp

267 	register Handle_t*	mp;
278 if (!(mp = newof(0, Handle_t, 1, n)))
281 n = getfsstat(mp->next = mp->buf, n + sizeof(struct statfs), MNT_WAIT);
283 n = getmntinfo(&mp->next, 0);
287 free(mp);
290 mp->last = mp->next + n;
291 return (void*)mp;
297 register Handle_t* mp = (Handle_t*)handle;
302 if (mp->next < mp->last)
304 flags = mp->next->f_flags;
308 n += sfsprintf(mp->opt + n, sizeof(mp->opt) - n - 1, ",%s", options[i].name);
309 set(&mp->hdr, mp->next->f_mntfromname, mp->next->f_mntonname, TYPE(mp->next), n ? (mp->opt + 1) : (char*)0);
310 mp->next++;
311 return &mp->hdr.mnt;
319 register Handle_t* mp = (Handle_t*)handle;
321 if (!mp)
323 free(mp);
357 register Handle_t* mp;
360 if (!(mp = newof(0, Handle_t, 1, SIZE)))
362 if ((mp->count = mntctl(MCTL_QUERY, sizeof(Handle_t) + SIZE, &mp->info)) <= 0)
364 free(mp);
367 mp->next = mp->info;
368 return (void*)mp;
374 register Handle_t* mp = (Handle_t*)handle;
379 if (mp->count > 0)
381 if (vmt2datasize(mp->next, VMT_HOST) && (s = vmt2dataptr(mp->next, VMT_HOST)) && !streq(s, "-"))
383 sfsprintf(mp->remote, sizeof(mp->remote) - 1, "%s:%s", s, vmt2dataptr(mp->next, VMT_OBJECT));
384 s = mp->remote;
387 s = vmt2dataptr(mp->next, VMT_OBJECT);
388 if (vmt2datasize(mp->next, VMT_ARGS))
389 o = vmt2dataptr(mp->next, VMT_ARGS);
392 switch (mp->next->vmt_gfstype)
435 sfsprintf(t = mp->type, sizeof(mp->type), "aix%+d", mp->next->vmt_gfstype);
438 set(&mp->hdr, s, vmt2dataptr(mp->next, VMT_STUB), t, o);
439 if (--mp->count > 0)
440 mp->next = (struct vmount*)((char*)mp->next + mp->next->vmt_length);
441 return &mp->hdr.mnt;
449 register Handle_t* mp = (Handle_t*)handle;
451 if (!mp)
453 free(mp);
541 register Handle_t* mp;
544 if (!(mp = newof(0, Handle_t, 1, 0)))
546 if (!(mp->fp = setmntent(path, mode)))
548 free(mp);
551 return (void*)mp;
557 register Handle_t* mp = (Handle_t*)handle;
560 if (mnt = getmntent(mp->fp))
562 set(&mp->hdr, mnt->mnt_fsname, mnt->mnt_dir, mnt->mnt_type, OPTIONS(mnt));
563 return &mp->hdr.mnt;
571 register Handle_t* mp = (Handle_t*)handle;
573 if (!mp)
575 endmntent(mp->fp);
576 free(mp);
655 register Handle_t* mp;
658 if (!(mp = newof(0, Handle_t, 1, 0)))
661 if ((mp->count = w_getmntent(mp->buf, sizeof(mp->buf))) > 0)
662 mp->mnt = (struct mntent*)(((struct w_mnth*)mp->buf) + 1);
665 mp->mnt = (struct mntent*)mp->buf;
666 if (!(mp->fp = sfopen(NiL, path, mode)))
669 free(mp);
672 return (void*)mp;
678 register Handle_t* mp = (Handle_t*)handle;
682 if (mp->count-- <= 0)
684 if ((mp->count = w_getmntent(mp->buf, sizeof(mp->buf))) <= 0)
686 mp->count--;
687 mp->mnt = (struct mntent*)(((struct w_mnth*)mp->buf) + 1);
689 set(&mp->hdr, mp->mnt->mnt_fsname, mp->mnt->mnt_dir, mp->mnt->mnt_type, OPTIONS(mp->mnt));
690 mp->mnt++;
691 return &mp->hdr.mnt;
697 while (sfread(mp->fp, &mp->buf, sizeof(mp->buf)) == sizeof(mp->buf))
698 if (*mp->mnt->mnt_fsname && *mp->mnt->mnt_dir)
705 set(&mp->hdr, mp->mnt->mnt_fsname, mp->mnt->mnt_dir, stat(mp->mnt->mnt_dir, &st) ? FS_default : strlcpy(typ, fmtfs(&st), sizeof(typ)), OPTIONS(mp->mnt));
707 set(&mp->hdr, mp->mnt->mnt_fsname, mp->mnt->mnt_dir, mp->mnt->mnt_type, OPTIONS(mp->mnt));
709 return &mp->hdr.mnt;
725 b = s = mp->mnt->mnt_fsname;
726 m = s + sizeof(mp->mnt->mnt_fsname) - 1;
727 for (;;) switch (c = sfgetc(mp->fp))
748 b = s = mp->mnt->mnt_dir;
749 m = s + sizeof(mp->mnt->mnt_dir) - 1;
753 b = s = mp->mnt->mnt_type;
754 m = s + sizeof(mp->mnt->mnt_type) - 1;
758 b = s = mp->mnt->mnt_opts;
759 m = s + sizeof(mp->mnt->mnt_opts) - 1;
770 set(&mp->hdr, mp->mnt->mnt_fsname, mp->mnt->mnt_dir, mp->mnt->mnt_type, OPTIONS(mp->mnt));
771 return &mp->hdr.mnt;
789 register Handle_t* mp = (Handle_t*)handle;
791 if (!mp)
793 sfclose(mp->fp);
794 free(mp);