bsdgrep status
In 2011 I substituted grep for bsdgrep in some of my more complex shell scripts and ran into some issues. Though there never was a reply to my e-mail these issues have evidently been fixed. I'm tempted to conclude that bsdgrep is ready for deployment. Apart from the performance standpoint. I repeated the following several times the result is always about the same: # time -h pkg_libchk.gnu eclipse-3.7.1_4: /usr/local/lib/eclipse/configuration/org.eclipse.osgi/bundles/119/1/.cp/libswt-awt-gtk-3738.so misses libjawt.so libreoffice-4.0.1: /usr/local/lib/libreoffice/program/xpdfimport misses libpoppler.so.18 18m7.13s real 4m49.19s user 20m54.07s sys # time -h pkg_libchk.bsd eclipse-3.7.1_4: /usr/local/lib/eclipse/configuration/org.eclipse.osgi/bundles/119/1/.cp/libswt-awt-gtk-3738.so misses libjawt.so libreoffice-4.0.1: /usr/local/lib/libreoffice/program/xpdfimport misses libpoppler.so.18 20m30.75s real 5m10.25s user 22m6.71s sys I cannot say how much of the runtime is caused by grep, but all the difference is certainly made by grep and I think the difference is significant. It's maybe not bad enough to stop the switch, however it violates the noble tradition of having command line tools that are faster than the GNU equivalents. E.g. my latest AWK script is 7 times faster using one-true-awk, compared to GNU AWK. Compare bash and ash and you'll end up with a factor around 3 for scripts that mostly use builtin commands. Regards, Kami -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: sysctl way too slow
On 14/07/2010 13:49, Atom Smasher wrote: http://smasher.org/tmp/zsh-bsd-sysctl-slow.png Why use a screen shot here? is there a way to get this information that doesn't take so long? the same info is available on linux via /sys and /proc and on comparable hardware, i can get the info about 100x faster. It probably depends on your BIOS. This is the same call on my system: % time sysctl -n hw.acpi.battery.life hw.acpi.battery.time hw.acpi.battery.state 100 -1 0 sysctl -n hw.acpi.battery.life hw.acpi.battery.time hw.acpi.battery.state 0.00s user 0.01s system 96% cpu 0.013 total As you can see 33 times faster than on your system. I agree that 0.413 seconds is too long, but I don't think it makes sense to call this value more frequently than every 30 seconds. So I'd say it's more of an annoyance than a real problem. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: head behaviour
On 08/06/2010 00:59, Brian Somers wrote: On Mon, 07 Jun 2010 13:05:48 +0200, Dag-Erling Smørgrav d...@des.no wrote: Bakul Shah ba...@bitblocks.com writes: Except read doesn't do it quite right: $ ps | (read a; echo $a ; grep zsh) PID TT STAT TIME COMMAND yeah, I forgot that it drops leading whitespace... Well, leading $IFS $ ps | (IFS= read a; echo $a; grep zsh) works a lot better. As does using sed, which is the right tool for this kind of job anyway. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: head behaviour
On 05/06/2010 23:37, Bakul Shah wrote: On Sat, 05 Jun 2010 14:02:16 PDT Doug Barton do...@freebsd.org wrote: It would be less surprising and more useful if $ ps | (head -1; grep ssh) showed PID TT STAT TIME COMMAND all line with ssh in it The change in head behaviour I am suggesting wouldn't break anything that already works but make it more useful for what you call 'wacky commands lines'! I know this is besides the point you want to make, but I just cannot resist: # ps x | sed -e 1P -e '/ssh/\!d' -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: Activate PCIe slot deactivated by BIOS
On 25/05/2010 13:57, Rui Paulo wrote: On 22 May 2010, at 13:27, Dominic Fandrey wrote: On 22/05/2010 13:47, Dominic Fandrey wrote: Today the card arrived and the BIOS complains (HP 6510b): 104-Unsupported wireless network device detected. System halted. Remove device and restart. The system boots if I turn off the wireless device in BIOS, but this means I cannot use it. Now, I could just get a BIOS image and exchange the device IDs there. But I wonder, wouldn't it be easier to just reactivate the PCIe slot through the OS? This e-mail is written through the ath wireless I got: # ifconfig ath0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 2290 ether 00:24:2c:1d:f0:2f media: IEEE 802.11 Wireless Ethernet autoselect mode 11g status: associated ... wlan0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500 ether 00:24:2c:1d:f0:2f inet 192.168.178.41 netmask 0xff00 broadcast 192.168.178.255 media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g status: associated ssid Obi-Wan Kenobi channel 7 (2442 MHz 11g) bssid 00:15:0c:d5:37:a0 regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF AES-CCM 2:128-bit txpower 20 bmiss 7 scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme burst roaming MANUAL I achieved this by passing the BIOS check with the intel wireless and hot-swapping it with the atheros card afterwards. This is impractical and evil, so I'm still searching for a solution. But at least I know that the device works. HP laptops really dislike the fact that your card isn't part of the Centrino brand, so they halt if they find an Atheros. Your best option is to change the Atheros card EEPROM to match the device and vendor id of your wpi card. Then you also need to change the ath driver to attach to that device id. It's evil, but it's better than hot-swapping. Yes, but it still sucks. And I actually have no idea how to flash the ath device. All the instructions on this I have found use Linux. I'd prefer to flash the notebook BIOS, but I have no way to defeat its evil compression. The other option is to buy a iwn card which works better in FreeBSD than wpi. Nay, this is my goodbye to Intel brand wireless. I always thought wpa_supplicant was to blame for unreliable connections, but it all just works with the Atheros hardware. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: Activate PCIe slot deactivated by BIOS
On 26/05/2010 22:52, Rui Paulo wrote: On 26 May 2010, at 07:55, Dominic Fandrey kamik...@bsdforen.de wrote: On 25/05/2010 13:57, Rui Paulo wrote: On 22 May 2010, at 13:27, Dominic Fandrey wrote: On 22/05/2010 13:47, Dominic Fandrey wrote: Today the card arrived and the BIOS complains (HP 6510b): 104-Unsupported wireless network device detected. System halted. Remove device and restart. The system boots if I turn off the wireless device in BIOS, but this means I cannot use it. Now, I could just get a BIOS image and exchange the device IDs there. But I wonder, wouldn't it be easier to just reactivate the PCIe slot through the OS? This e-mail is written through the ath wireless I got: # ifconfig ath0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 2290 ether 00:24:2c:1d:f0:2f media: IEEE 802.11 Wireless Ethernet autoselect mode 11g status: associated ... wlan0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500 ether 00:24:2c:1d:f0:2f inet 192.168.178.41 netmask 0xff00 broadcast 192.168.178.255 media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g status: associated ssid Obi-Wan Kenobi channel 7 (2442 MHz 11g) bssid 00:15:0c:d5:37:a0 regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF AES-CCM 2:128-bit txpower 20 bmiss 7 scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme burst roaming MANUAL I achieved this by passing the BIOS check with the intel wireless and hot-swapping it with the atheros card afterwards. This is impractical and evil, so I'm still searching for a solution. But at least I know that the device works. HP laptops really dislike the fact that your card isn't part of the Centrino brand, so they halt if they find an Atheros. Your best option is to change the Atheros card EEPROM to match the device and vendor id of your wpi card. Then you also need to change the ath driver to attach to that device id. It's evil, but it's better than hot-swapping. Yes, but it still sucks. And I actually have no idea how to flash the ath device. All the instructions on this I have found use Linux. Please ask s...@freebsd.org about that. I'd prefer to flash the notebook BIOS, but I have no way to defeat its evil compression. I think flashing the bios is more risky than fixing the EEPROM. Yes, it's a philosophical thing. By flashing the BIOS I address the error. By changing the wireles EEPROM I counter the error with another error. The other option is to buy a iwn card which works better in FreeBSD than wpi. Nay, this is my goodbye to Intel brand wireless. I always thought wpa_supplicant was to blame for unreliable connections, but it all just works with the Atheros hardware. Intel has made progress and I really think that they are on the right track to produce good cards. While wpi is the first one in my care that does not work at all, all other Intel brand wireless devices in my use have proven to be at least unreliable. So what if they work reliable one day. The Atheros I got is reliable, now! Not in a far fetched future that might never actually come to be. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Activate PCIe slot deactivated by BIOS
My wpi wireless never was reliable, but since I upgraded to 8gb RAM it doesn't do anything (if I'm lucky) or panic my system. So, after some discussion on STABLE I followed the recommendation to get an Atheros card for 10$ on ebay. Today the card arrived and the BIOS complains (HP 6510b): 104-Unsupported wireless network device detected. System halted. Remove device and restart. The system boots if I turn off the wireless device in BIOS, but this means I cannot use it. Now, I could just get a BIOS image and exchange the device IDs there. But I wonder, wouldn't it be easier to just reactivate the PCIe slot through the OS? -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: Activate PCIe slot deactivated by BIOS
On 22/05/2010 13:47, Dominic Fandrey wrote: Today the card arrived and the BIOS complains (HP 6510b): 104-Unsupported wireless network device detected. System halted. Remove device and restart. The system boots if I turn off the wireless device in BIOS, but this means I cannot use it. Now, I could just get a BIOS image and exchange the device IDs there. But I wonder, wouldn't it be easier to just reactivate the PCIe slot through the OS? This e-mail is written through the ath wireless I got: # ifconfig ath0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 2290 ether 00:24:2c:1d:f0:2f media: IEEE 802.11 Wireless Ethernet autoselect mode 11g status: associated ... wlan0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500 ether 00:24:2c:1d:f0:2f inet 192.168.178.41 netmask 0xff00 broadcast 192.168.178.255 media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g status: associated ssid Obi-Wan Kenobi channel 7 (2442 MHz 11g) bssid 00:15:0c:d5:37:a0 regdomain 101 indoor ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF AES-CCM 2:128-bit txpower 20 bmiss 7 scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme burst roaming MANUAL I achieved this by passing the BIOS check with the intel wireless and hot-swapping it with the atheros card afterwards. This is impractical and evil, so I'm still searching for a solution. But at least I know that the device works. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: proposed change to style(9): require yoda style if statements
On 11/05/2010 21:36, Eitan Adler wrote: My proposal is simple: require that any if statement that compares a constant to a mutable variable be written as if (constant == variable) instead of if (variable == constant) this prevents an extremely common programming error if (variable = constant) While this is almost always found in testing sometimes thing can slip through and writing it using the former method will generate a compiler warning. Is this suggestion due to the discussions around yoda-style in the comments of: http://www.globalnerdy.com/2010/05/09/new-programming-jargon/ I think the pro-yoda faction actually has more convincing arguments, though I never considered using yoda-style myself. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: proposed change to style(9): require yoda style if statements
On 12/05/2010 14:43, Dag-Erling Smørgrav wrote: Dominic Fandrey kamik...@bsdforen.de writes: I think the pro-yoda faction actually has more convincing arguments, Which ones? Never seen any beyond the basic helps avoid accidentally typing = instead of ==. It's bollocks, anyway, because a) for every (variable == constant) comparison you have ten (variable == variable) comparisons and b) good compilers will warn about bare assignments used as conditions. The only practical effect of Yoda style is to make code harder to read. The convincing one applies to Java and C++: if (constant.equals(object)) instead of if (object != null object.equals(constant)) actually looks easier to read. Though you are right about constants being pretty rare. Your .sig is strangely appropriate... Not my invention, this is a pretty common one, used by many people on the net. I actually have no idea where it comes from. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: GSoC: Making ports work with clang
On 03/05/2010 12:38, C. Bergström wrote: What's really the goal here? In my opinion it's about staying away from the GPLv3. According to my understanding of the situation, GPLv3 code is not accepted into the project and that means we're stuck with gcc 4.2, which has already reached its EOL. The way I see it we /desperately/ need a new compiler for the base system. Having GPLv3 stuff in Ports is all right, so getting the base system to compile was the most important step. Now that it does I think the change should be made as soon as all the supported architectures work with clang. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: GSoC: Making ports work with clang
Hello, On 01/05/2010 13:04, Andrius Morkūnas wrote: I'm Andrius Morkūnas from Lithuania. My Summer of Code proposal was accepted this year and be working on my project, which is to make clang and ports to be friendly with each other. I'm the maintainer of games/ioquake3 and games/ioquake3-devel. I'm currently working on getting ioquake3 clang compatible. It already compiles (the modding tools, which I intended to add to the port are still broken), but there are some rendering issues that are my top priority to solve at the moment. Any way, if you need feedback, consider me an interested party. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: grep
On 30/03/2010 16:15, Mark nesterovych wrote: Decided to write BSD licensed grep and provide it to FreeBSD project if success. But encountered with a problem, which I can resolve. I looked through the gnu, OpenBSD sources and posix requirements to this utility, and can't find a solution. ... If FreeBSD is your primary target platform, I'd suggest to do whatever the currently present implementation of grep does. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: nroff -man, .An Aq formatting
On 22/03/2010 16:05, Christian Weisgerber wrote: Dag-Erling Smørgrav d...@des.no wrote: It has come to my attention that whereas with LANG=C nroff -man formats .An name Aq email as name email, it uses different characters with LANG=en_GB.UTF-8 name ⟨email⟩. These characters are appropriate, but a lot of unicode fonts don't seem to have them. This is definitely a bug, since (as avg@ points out) you can no longer copy-paste the name address into an email client. AFAIK (judging from the Unicode group they're in) these characters are intended mainly for writing things like ENTER and CTRL+F1 in technical documentation. And we probably have that usage in other man pages. It is not clear to me if the problem is the use of these characters for angle quotes or the use of .Aq for email addresses. I got it out of the wpi(4) manual first. It probably appears in other places, too. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: nroff -man, .An Aq formatting
On 22/03/2010 02:20, Doug Barton wrote: On 03/21/10 01:24, Dominic Fandrey wrote: It has come to my attention that whereas with LANG=C nroff -man formats .An name Aq email as name email, it uses different characters with LANG=en_GB.UTF-8 name ⟨email⟩. These characters are appropriate, but a lot of unicode fonts don't seem to have them. Or else my terminal (rxvt-unicode) has trouble displaying them. Does anybody know a workaround for this? AFAIK our standard is -mdoc, not -man. Is there a specific purpose for which you need -man? And if not does the problem exist with -mdoc? Ah, I didn't know that. Doesn't seem to make a difference, though. Still, I'll test my pages with -mdoc instead of -man in the future. Thanks a lot! -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
dumping on a small swap partition
The swap partition of my notebook is only 4gb small, whereas the system has 8gb of RAM. Is there a way to convince the system of dumping despite this? The system panics quite often since I crossed the 4gb memory boundary and it never dumps. I think that a minidump should in most cases fit well into my swap space. I'm running RELENG_8. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
nroff -man, .An Aq formatting
It has come to my attention that whereas with LANG=C nroff -man formats .An name Aq email as name email, it uses different characters with LANG=en_GB.UTF-8 name ⟨email⟩. These characters are appropriate, but a lot of unicode fonts don't seem to have them. Or else my terminal (rxvt-unicode) has trouble displaying them. Does anybody know a workaround for this? -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: nroff -man, .An Aq formatting
On 21/03/2010 11:02, Andriy Gapon wrote: on 21/03/2010 10:24 Dominic Fandrey said the following: It has come to my attention that whereas with LANG=C nroff -man formats .An name Aq email as name email, it uses different characters with LANG=en_GB.UTF-8 name ⟨email⟩. These characters are appropriate, but a lot of unicode fonts don't seem to have them. Are you sure that they are even appropriate? E.g. I think you won't be able to copy+paste such an address to any mail client. Well, that's just how I got them into the mail. I copied them out of the terminal, that displays a square instead of the characters, into my mail client, which displays them just fine. My opinion is that ASCII angle brackets are the most appropriate here. I don't know about that, but they sure would be most convenient. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: Unicode in Syscons: I'd like to go on
On 17/03/2010 15:34, Alexander Churanov wrote: Hi folks! Some time ago I was initiating the work on syscons driver ( see http://wiki.freebsd.org/SysconsUnicodeProject ), then was too busy and my part of the work stalled for about a year. At present I am going to continue working on this. ... Did you receive any responses to your mail? I'm kind of a unicode fan boy and I'd like to know, whether something is happening. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Re: Fw: request responsibility timeout
Mark Linimon wrote: On Mon, Feb 02, 2009 at 05:17:38PM +0100, Dominic Fandrey wrote: I want to request a responsibility timeout for bin/120784 (with bugmeister hat) AFAIK no one else other than rodrigc has been doing work on the mount utilities, so I don't know who else to assign it to. mcl I suppose I'll just have to wait. Thank you for taking a look. Regards ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
Fw: request responsibility timeout
Mel wrote: On Sunday 01 February 2009 07:48:46 Dominic Fandrey wrote: I want to request a responsibility timeout for bin/120784, I have submitted a patch matching the previously discussed criteria for a commit a couple of weeks ago and I would like to receive some kind of reaction. What is the appropriate channel to do so? -hackers (forwarded to hackers) ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org
deflate and gzip support for libfetch over http
I wanted to benchmark a http-connection using fetch in a shell-script. I came to realize that fetch doesn't support compressed streams when I force-fed it the compressed stream by ignoring the absence of Accept-Encoding. This doesn't influence my benchmarking, but I think fetch should have this feature. I hacked together deflate support for the http part of libfetch. Next on my todo list is proper error handling, gzip support, code clean up and general code clean up in http.c (in order of priority). I'd love to get some feedback, do you consider this useful? Does it work on your system? Would there be a chance of getting the finalized version into SVN? The attached patch applies to RELENG_7. Probably everywhere else, too. Because I think libfetch development has been at a halt for some time. Regards, Dominic --- src/lib/libfetch/http.c.orig2008-06-29 15:28:58.0 +0200 +++ src/lib/libfetch/http.c 2008-06-30 19:38:57.0 +0200 @@ -75,6 +75,7 @@ #include string.h #include time.h #include unistd.h +#include zlib.h #include netinet/in.h #include netinet/tcp.h @@ -105,7 +106,6 @@ #define HTTP_ERROR(xyz) ((xyz) 400 (xyz) 599) - /* * I/O functions for decoding chunked streams */ @@ -126,6 +126,16 @@ #endif }; +struct zlibio +{ + FILE*source;/* the http connection to read from */ + z_stream*stream;/* the zlib stream to read the */ + /* uncompressed data from */ + charin[65536]; /* read buffer */ +}; + +typedef FILE * (*funopen_function)(conn_t *, int); + /* * Get next chunk header */ @@ -302,10 +312,50 @@ } /* + * Read function for deflate compressed data. + */ +static int +http_inflate_readfn(void *v, char *buf, int len) +{ + struct zlibio *io = (struct zlibio *)v; + int status; + + /* Only read if the last read chunk has completely been flushed. */ + if (io-stream-avail_in == 0) { + io-stream-avail_in = fread(io-in, sizeof(char), sizeof(io-in), io-source); + + /* Forward errors and eof */ + if (io-stream-avail_in = 0) + return io-stream-avail_in; + + io-stream-next_in = io-in; + } + + io-stream-avail_out = len; + io-stream-next_out = buf; + status = inflate(io-stream, Z_SYNC_FLUSH); + + return (len - io-stream-avail_out); +} + +/* + * Close function for deflate compressed data + */ +static int +http_inflate_closefn(void *v) +{ + struct zlibio *io = (struct zlibio *)v; + + (void)inflateEnd(io-stream); + free(io-stream); + return (fclose(io-source)); +} + +/* * Wrap a file descriptor up */ static FILE * -http_funopen(conn_t *conn, int chunked) +http_funopen_raw(conn_t *conn, int chunked) { struct httpio *io; FILE *f; @@ -316,7 +366,7 @@ } io-conn = conn; io-chunked = chunked; - f = funopen(io, http_readfn, http_writefn, NULL, http_closefn); + f = funopen(io, http_readfn, http_writefn, NULL, http_closefn); if (f == NULL) { fetch_syserr(); free(io); @@ -325,6 +375,50 @@ return (f); } +/* + * Wrap a file descriptor up around the zlip inflate command + */ +static FILE * +http_funopen_inflate(conn_t *conn, int chunked) +{ + struct zlibio *io; + FILE *f; + + if ((io = calloc(1, sizeof(*io))) == NULL) { + fetch_syserr(); + return (NULL); + } + + io-source = http_funopen_raw(conn, chunked); + + if ((io-stream = calloc(1, sizeof(*(io-stream == NULL) { + fetch_syserr(); + free(io); + return (NULL); + } + + io-stream-zalloc = Z_NULL; + io-stream-zfree = Z_NULL; + io-stream-opaque = Z_NULL; + io-stream-avail_in = 0; + io-stream-next_in = Z_NULL; + if (inflateInit2(io-stream, -MAX_WBITS) != Z_OK) { + fetch_syserr(); + free(io-source); + free(io); + return (NULL); + } + + f = funopen(io, http_inflate_readfn, NULL, NULL, http_inflate_closefn); + + if (f == NULL) { + fetch_syserr(); + free(io-source); + free(io); + return (NULL); + } + return f; +} /* * Helper functions for talking to the server and parsing its replies @@ -336,6 +430,7 @@ hdr_error = -1, hdr_end = 0, hdr_unknown = 1, + hdr_content_encoding, hdr_content_length, hdr_content_range, hdr_last_modified, @@ -349,6 +444,7 @@ hdr_tnum; const char *name; } hdr_names[] = { + {
Re: FreeBSD fusefs-kmod shutdown problem workaround
Kostik Belousov wrote: On Mon, Jun 23, 2008 at 02:41:29PM -0400, Zaphod Beeblebrox wrote: On Mon, Jun 23, 2008 at 2:41 AM, Dominic Fandrey [EMAIL PROTECTED] wrote: Thanks for the pointer. Unfortunately it seems that Csaba's patch only allows you to stall shutdown for 10 seconds. After heavy writing more than a minute can be necessary to prevent data loss. I have created a problem report: ports/124901 http://www.freebsd.org/cgi/query-pr.cgi?pr=124901 I hope this will make it. To me data loss and file system corruption are the worst case scenario and to me it's worth stalling shutdown for as long as it takes to write the data. The shutdown watchdog timer is something I've had to adjust many times for many different ports. Given this; I propose we have (at least) a new rcorder script variable. Something like SHUTTIME encoding the expected number of seconds required for the daemon to shutdown in the worst case. Ideally, you'd want an overall watchdog and a per-script watchdog (so that you're not waiting the sum of all these times in most cases). We already have rcshutdown_timeout, see the rc.conf(5) and description of the sysctl kern.init_shutdown_timeout. He knows that. He just wants something more fine-grained. And rcshutdown_timeout has to be set by the user. Following Zaphod's suggestion I'd like to have a more generous watchdog default (maybe 3 minutes) and a per script watchdog that defaults to something around 30 seconds, but can be changed in the rc script. I'll give that a try tonight. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: FreeBSD fusefs-kmod shutdown problem workaround
Anish Mistry wrote: On Sunday 22 June 2008, Dominic Fandrey wrote: I know these are desperate mesures, but the problem that fusefs doesn't write everything back to the disk before a shutdown is completed remains, because the rc script is often shot down by the shutdown watchdog. Hence I have extended my workaround to force stop the watchdog until everything is written to the media. Regards, Dominic diff -Pur ports/sysutils/fusefs-kmod.orig/files/fusefs.in ports/sysutils/fusefs-kmod/files/fusefs.in --- ports/sysutils/fusefs-kmod.orig/files/fusefs.in 2008-06-22 21:35:27.0 +0200 +++ ports/sysutils/fusefs-kmod/files/fusefs.in 2008-06-22 21:44:34.0 +0200 @@ -50,9 +50,18 @@ ;; esac done + + # This is an evil yet necessary hack to give fuse the time to + # write all data to the media before the system is shut down. + if [ -n $rcshutdown_timeout -a -n $_rcshutdown_watchdog ]; then + /bin/kill -STOP $_rcshutdown_watchdog + fi until kldunload $kmod; do /bin/sleep 0.25 done + if [ -n $rcshutdown_timeout -a -n $_rcshutdown_watchdog ]; then + /bin/kill -CONT $_rcshutdown_watchdog + fi } load_rc_config $name Please open a PR, this is out of my comfort zone by doing evil stuff during shutdown. It would probably be helpful to bring up this on hackers/current by showing your patch. Hopefully we can get some attention and get the necessary changes in the base/kernel to do this right. It does look like there is a solution in Csaba's development version. Did you take a look at Csaba's message on hackers at the beginning of January? Thanks for the pointer. Unfortunately it seems that Csaba's patch only allows you to stall shutdown for 10 seconds. After heavy writing more than a minute can be necessary to prevent data loss. I have created a problem report: ports/124901 http://www.freebsd.org/cgi/query-pr.cgi?pr=124901 I hope this will make it. To me data loss and file system corruption are the worst case scenario and to me it's worth stalling shutdown for as long as it takes to write the data. Regards, Dominic ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
making geom recognize cd changes
I'm trying to get geom to recognize atapi-cd changes in order to update the labels. I'm concentrating my efforts on src/sys/dev/ata/atapi-cd.c. I have tried to run acd_geom_attach and acd_geom_detach both directly and through the geom queue from acd_tray, but there is no effect. Something about my approach seems to be entirely wrong. Please make sure to CC me, I'm not subscribed to this list. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]