title: Port Window Api---GetVolumeInformation to Linux
body: <p>win Api</p>
  
  <pre><code>WINAPI GetVolumeInformation(
  _In_opt_   LPCTSTR lpRootPathName,
  _Out_opt_  LPTSTR lpVolumeNameBuffer,
  _In_       DWORD nVolumeNameSize,
  _Out_opt_  LPDWORD lpVolumeSerialNumber,
  _Out_opt_  LPDWORD lpMaximumComponentLength,
  _Out_opt_  LPDWORD lpFileSystemFlags,
  _Out_opt_  LPTSTR lpFileSystemNameBuffer,
  _In_       DWORD nFileSystemNameSize
  );
  </code></pre>
  
  <p>Hello: I want to port windows api GetVolumeInformation to Linux.</p>
  
  <p>Q1:Does Linux have the same function.</p>
  
  <p>Q2:if not. </p>
  
  <p>Q2.1 what is lpVolumeNameBuffer in linux(is /dev/sda1)? how can i get it in linux?</p>
  
  <p>Q2.2 what is lpVolumeSerialNumber in linux(is )? i use ioctl get it.</p>
  
  <p><code>struct hd_driveid id;ioctl(fd, HDIO_GET_IDENTITY, &amp;id);</code></p>
  
  <p>Q2.3 what is lpMaximumComponentLength in linux? how can i get it in linux?</p>
  
  <p>Q2.4 what is lpFileSystemFlags in linux? how can i get it in linux?</p>
  
  <p>Q2.5 what is lpFileSystemNameBuffer? how can i get it in linux?</p>
  
  <p>If you have any good ideas I would really appreciate it.</p>
  
  <p>Thanks!</p>