From owner-freebsd-questions@FreeBSD.ORG Sat Dec 26 17:51:30 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3B9106568D for ; Sat, 26 Dec 2009 17:51:30 +0000 (UTC) (envelope-from invalid.pointer@gmail.com) Received: from mail-gx0-f218.google.com (mail-gx0-f218.google.com [209.85.217.218]) by mx1.freebsd.org (Postfix) with ESMTP id 44E838FC19 for ; Sat, 26 Dec 2009 17:51:29 +0000 (UTC) Received: by gxk10 with SMTP id 10so8930174gxk.3 for ; Sat, 26 Dec 2009 09:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=w0uMswL5HPRrVuqvqqhTGz0FE4CkkJw3GNvh2PYMQGw=; b=vTPvQ3Cl+hsyb7UT52fKNQvwJPVCOCM2qDIFQJhqFAWzSImOnllw4UpKkbzJ63ysQM uvhMX+lfAxnGNXYOiRczSY/aBlHH0BSBRu7RmZtLBVGhDmBJU6QLq/m+S4SGUJIFFo2A TAvtf4Ehz5teCC0BccyEgHKUTdtQG5H8y6Se8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=l+m2xqDgYNHCE4q9XjMnd2OwESC/MOh+KCjHQOjXwpZM/mcvFf0+47oytsp+v4UGIs TicyqnizVI/sUkuIz2zotj9ZgTe0s1xtvaF23sapC6QzPOLzgHmEDcZAnYOM0EaoOYDo I27X1s9q3muuOjZgXwb+SCLATWwxbU/wXDg2M= Received: by 10.100.17.30 with SMTP id 30mr20194578anq.156.1261849889299; Sat, 26 Dec 2009 09:51:29 -0800 (PST) Received: from ?192.168.1.78? ([122.162.53.111]) by mx.google.com with ESMTPS id 20sm9336652iwn.9.2009.12.26.09.51.26 (version=SSLv3 cipher=RC4-MD5); Sat, 26 Dec 2009 09:51:28 -0800 (PST) Message-ID: <4B364D3B.4030504@gmail.com> Date: Sat, 26 Dec 2009 23:21:55 +0530 From: Manish Jain User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <20091226120027.952D110656CE@hub.freebsd.org> In-Reply-To: <20091226120027.952D110656CE@hub.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: freebsd-questions Digest, Vol 290, Issue 12 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 17:51:30 -0000 Hello, I am looking a convenient way using C to retrieve the current CPU and memory utilization of a process of which I have the pid. Can somebody please give me a hint of which system-calls/library-functions to use for this ? I don't want to use the system() function or grep for information via the /proc filesystem. I would be grateful if you could also please mention whether the suggested method[s] is/are FreeBSD-specific or would be portable to other environments like Solaris/Linux ? Thanks for any help. Regards & Happy New Year Manish Jain invalid.pointer@gmail.com freebsd-questions-request@freebsd.org wrote: > Send freebsd-questions mailing list submissions to > freebsd-questions@freebsd.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > or, via email, send a message with subject or body 'help' to > freebsd-questions-request@freebsd.org > > You can reach the person managing the list at > freebsd-questions-owner@freebsd.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of freebsd-questions digest..." > > > Today's Topics: > > 1. setlocale command is missing (Daniel Dvo??k) > 2. Re: clicky driver (Roland Smith) > 3. Package Dependency Issue (Joseph L. Casale) > 4. Re: setlocale command is missing (Rolf G Nielsen) > 5. Fwd: location of discussion of livefs > (leeoliveshackelford@surewest.net) > 6. Failed port upgrade (Rem P Roberti) > 7. Re: freebsd for children (Ian Smith) > 8. Re: clicky driver (Gary Kline) > 9. Re: clicky driver (Gary Kline) > 10. portaudit php vulnerabilities (Aleksandr Miroslav) > 11. Re: Firefox 3.5 and Epiphany crashing since the GNOME 2.28 > update (Neil Short) > 12. Re: portaudit php vulnerabilities (Nerius Landys) > 13. ANNOUNCE: 64 bit 8.0-RELEASE-p1 Custom XFCE build available > (Manolis Kiagias) > 14. Re: freebsd for children (Dh?nin Jean-Jacques) > 15. Punam Chowhan sent you a private message on Feed Share - > please respond (Punam Chowhan) > 16. Re: location of discussion of lives (Matthew Seaman) > 17. Re: clicky driver (Matthew Seaman) > 18. Re: Wireless USB adapter (Paul B Mahol) > 19. Re: clicky driver (Nick Barnes) > 20. Re: Upgrade 7.0 to 7.2 installworld failed - SOLVED (Colin) > 21. Re: Firefox 3.5 and Epiphany crashing since the GNOME 2.28 > update (Anh Ky Huynh) > 22. Re: portaudit php vulnerabilities (Jerry) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 26 Dec 2009 02:04:44 +0100 > From: Daniel Dvo??k > Subject: setlocale command is missing > To: > Message-ID: <9FFCA7E178C44C10994E4C52AC40EDA4@tocnet28.jspoj.czf> > Content-Type: text/plain; charset="utf-8" > > Hi, > > I updated a mc port to the last one, version 4.7.0pre4 and wanted to run mc, but mc display a warning message that the selected display charset or source codeset does not match one set via locale. I have never seen this message since I am a user of mc. Propably it is something new in this new version. The version 4.6.2 does not show you this message durring starting application. > > I wanted to set my locale, but I found out that command setlocale is missing on FreeBSD 7.2. > > Files in directory /etc: > > login.conf, login.conf.db, csh.login and profile are set as HANDBOOK recommends for language localization. > > My shells are bash, tcsh or zsh, csh for root user. The results are the same. > > bash: > [user@server ~]$ LC_ALL=ISO-8859-2; export LC_ALL > -bash: varování: setlocale: LC_ALL: cannot change locale (ISO-8859-2): No such file or directory > > zsh: > server% setlocale LC_ALL ISO-8859-2 > zsh: command not found: setlocale > > tcsh: > >> setlocale LC_ALL ISO-8859-2 >> > setlocale: Command not found. > > root csh: > server# setlocale LC_ALL ISO-8859-2 > setlocale: Command not found. > > So my simple question is why is setlocale command missing in FreeBSD 7.2 ? And if user could not use locale and setlocale commands like on Linux, how can I solve my problem with new version of MC ? > > The mc message: > > Confirmation > > Chosen display charset (Settings->Display bits) or source codeset (in mcedit ctrl-t) does not match one set via locale. Set correct codeset manually or press <> to set locale default. > > Or set 'don' task again' and press <> > > [ ] don't ask again > > [< Fix it >] [ Skip ] > > BTW in mc there is not any settings with display bits, there is only options menu with display bits. Wrong help dialogs ? > > Thank you > > Daniel > > > > > ------------------------------ > > Message: 2 > Date: Sat, 26 Dec 2009 02:43:56 +0100 > From: Roland Smith > Subject: Re: clicky driver > To: Gary Kline > Cc: FreeBSD Mailing List > Message-ID: <20091226014356.GB10072@slackbox.xs4all.nl> > Content-Type: text/plain; charset="us-ascii" > > On Fri, Dec 25, 2009 at 12:47:49PM -0800, Gary Kline wrote: > >> Nothing tactile, and because neither Linux nor BSD has an audio >> "click", not even that. Sun does have a command line >> > > It should. The X window system provides a way to get keyclicks with > xset(1). The command 'xset c 100' whould generate the loudest click possible. > > Whether you hear something depends e.g. on how the X server is started, and > wether the hardware supports it. On my PC I hear the 'bell' from the PC > speaker, but no clicks. > > Roland >