132 KMountPoint::List result;
135 STRUCT_SETMNTENT fstab;
136 if ((fstab = SETMNTENT(FSTAB,
"r")) == 0)
140 while (GETMNTENT(fstab, fe))
143 mp->m_mountedFrom = TQFile::decodeName(FSNAME(fe));
145 mp->m_mountPoint = TQFile::decodeName(MOUNTPOINT(fe));
146 mp->m_mountType = TQFile::decodeName(MOUNTTYPE(fe));
150 if (infoNeeded & NeedMountOptions || (mp->m_mountType ==
"supermount"))
152 TQString options = TQFile::decodeName(MOUNTOPTIONS(fe));
153 mp->m_mountOptions = TQStringList::split(
',', options);
156 if(mp->m_mountType ==
"supermount")
159 if (infoNeeded & NeedRealDeviceName)
161 if (mp->m_mountedFrom.startsWith(
"/"))
170 if ( !f.open(IO_ReadOnly) )
178 s=t.readLine().simplifyWhiteSpace();
179 if ( s.isEmpty() || (s[0] ==
'#'))
183 TQStringList item = TQStringList::split(
' ', s);
186 if (item.count() < 5)
189 if (item.count() < 4)
196 mp->m_mountedFrom = item[i++];
201 mp->m_mountPoint = item[i++];
202 mp->m_mountType = item[i++];
203 TQString options = item[i++];
205 if (infoNeeded & NeedMountOptions)
207 mp->m_mountOptions = TQStringList::split(
',', options);
210 if (infoNeeded & NeedRealDeviceName)
212 if (mp->m_mountedFrom.startsWith(
"/"))
226 KMountPoint::List result;
228#ifdef HAVE_GETMNTINFO
230#ifdef GETMNTINFO_USES_STATVFS
231 struct statvfs *mounted;
233 struct statfs *mounted;
236 int num_fs = getmntinfo(&mounted, MNT_NOWAIT);
238 for (
int i=0;i<num_fs;i++)
241 mp->m_mountedFrom = TQFile::decodeName(mounted[i].f_mntfromname);
242 mp->m_mountPoint = TQFile::decodeName(mounted[i].f_mntonname);
245 mp->m_mountType = TQFile::decodeName(mnt_names[mounted[i].f_type]);
247 mp->m_mountType = TQFile::decodeName(mounted[i].f_fstypename);
250 if (infoNeeded & NeedMountOptions)
252 struct fstab *ft = getfsfile(mounted[i].f_mntonname);
253 TQString options = TQFile::decodeName(ft->fs_mntops);
254 mp->m_mountOptions = TQStringList::split(
',', options);
257 if (infoNeeded & NeedRealDeviceName)
259 if (mp->m_mountedFrom.startsWith(
"/"))
268 struct vmount *mntctl_buffer;
275 mntctl_buffer = (
struct vmount*)malloc(buf_sz);
276 num = mntctl(MCTL_QUERY, buf_sz, mntctl_buffer);
279 buf_sz = *(
int*)mntctl_buffer;
281 mntctl_buffer = (
struct vmount*)malloc(buf_sz);
282 num = mntctl(MCTL_QUERY, buf_sz, mntctl_buffer);
288 vm = (
struct vmount *)mntctl_buffer;
289 for ( ; num > 0; num-- )
292 fsname_len = vmt2datasize(vm, VMT_STUB);
293 mountedto = (
char*)malloc(fsname_len + 1);
294 mountedto[fsname_len] =
'\0';
295 strncpy(mountedto, (
char *)vmt2dataptr(vm, VMT_STUB), fsname_len);
297 fsname_len = vmt2datasize(vm, VMT_OBJECT);
298 mountedfrom = (
char*)malloc(fsname_len + 1);
299 mountedfrom[fsname_len] =
'\0';
300 strncpy(mountedfrom, (
char *)vmt2dataptr(vm, VMT_OBJECT), fsname_len);
306 struct vfs_ent* ent = getvfsbytype(vm->vmt_gfstype);
309 mp->m_mountedFrom = TQFile::decodeName(mountedfrom);
310 mp->m_mountPoint = TQFile::decodeName(mountedto);
311 mp->m_mountType = TQFile::decodeName(ent->vfsent_name);
316 if (infoNeeded & NeedMountOptions)
321 if (infoNeeded & NeedRealDeviceName)
323 if (mp->m_mountedFrom.startsWith(
"/"))
330 vm = (
struct vmount *)((
char *)vm + vm->vmt_length);
336 free( mntctl_buffer );
337#elif defined(TQ_WS_WIN)
340 STRUCT_SETMNTENT mnttab;
341 if ((mnttab = SETMNTENT(MNTTAB,
"r")) == 0)
345 while (GETMNTENT(mnttab, fe))
348 mp->m_mountedFrom = TQFile::decodeName(FSNAME(fe));
350 mp->m_mountPoint = TQFile::decodeName(MOUNTPOINT(fe));
351 mp->m_mountType = TQFile::decodeName(MOUNTTYPE(fe));
355 if (infoNeeded & NeedMountOptions || (mp->m_mountType ==
"supermount"))
357 TQString options = TQFile::decodeName(MOUNTOPTIONS(fe));
358 mp->m_mountOptions = TQStringList::split(
',', options);
361 if (mp->m_mountType ==
"supermount")
364 if (infoNeeded & NeedRealDeviceName)
366 if (mp->m_mountedFrom.startsWith(
"/"))