3 ms·
The switch from 2.4 to 2.6 had a lot of changes and a lot of programs needed to check the version to see which behavior to use. There are two ways to do that sh
by nuxi7 12y ago
The switch from 2.4 to 2.6 had a lot of changes and a lot of programs needed to check the version to see which behavior to use. There are two ways to do that shown below in psuedo-python. This first way has no trouble with 3.x versions.
if kernel_version.startswith('2.4.'):
DO_A
else:
DO_B
On the other hand, if you check for 2.6 instead of checking for 2.4... Well when it encounters 3.0 the code falls back to 2.4 behavior.
if kernel_version.startswith('2.6.'):
DO_B
else:
DO_A
Sadly a number of binary only RAID tools don't really get updated much and have these problems. There is a program in util-linux named uname26 that you can run these tools under which gives them the 2.6.40+ version numbers.
This is just one of those tricks operating systems have to resort to from time to time, its like how Microsoft is skipping Windows 9 because of how many programs execute version.startswith('Windows 9') and assuming that means Win95/Win98.
- TorKlingberg 12y agoThank you for the explanation. > like how Microsoft is skipping Windows 9 because of how many programs execute version.startswith('Windows 9') and assuming that means Win95/Win98. Has this been confirmed, or is it just internet speculation?
- BuildTheRobots 12y agoThis isn't confirmation, but it certainly goes beyond speculation. https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29 https://searchcode.com/?q=if%28version%2Cstartswith%28%22win...
- Dylan16807 12y agoFrom what I understand, that Java API would not return "Windows 9". So while those tests are wrong, it would not cause a problem. I have not seen a single case proposed that would actually break.
- BuildTheRobots 12y agoDidn't realise that -thank you :)
- sp332 12y agoTwo people on reddit claiming to be Windows devs "confirmed" it. https://www.reddit.com/r/technology/comments/2hwlrk/new_windows_version_will_be_called_windows_10/ckwq83x https://www.reddit.com/r/technology/comments/2hwlrk/new_wind... https://www.reddit.com/r/technology/comments/2hwlrk/new_windows_version_will_be_called_windows_10/ckz812m https://www.reddit.com/r/technology/comments/2hwlrk/new_wind...