/[hurd]/hurd/tmpfs/tmpfs.c
ViewVC logotype

Diff of /hurd/tmpfs/tmpfs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by roland, Sun Mar 24 02:51:22 2002 UTC revision 1.10 by roland, Sun Mar 24 03:17:24 2002 UTC
# Line 186  parse_opt (int key, char *arg, struct ar Line 186  parse_opt (int key, char *arg, struct ar
186              case 'K':              case 'K':
187                size <<= 10;                size <<= 10;
188                break;                break;
189                case '%':
190                  {
191                    /* Set as a percentage of the machine's physical memory.  */
192                    struct vm_statistics vmstats;
193                    error_t err = vm_statistics (mach_task_self (), &vmstats);
194                    if (err)
195                      {
196                        argp_error (state, "cannot find total physical memory: %s",
197                                    strerror (err));
198                        return err;
199                      }
200                    size = round_page ((((vmstats.free_count
201                                          + vmstats.active_count
202                                          + vmstats.inactive_count
203                                          + vmstats.wire_count)
204                                         * vm_page_size)
205                                        * size + 99) / 100);
206                    break;
207                  }
208              }              }
209            size = (off_t) size;            size = (off_t) size;
210            if (size < 0)            if (size < 0)

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26